OSDN Git Service

Fix NPE due to progress bar not existing.
authorGeorge Mount <mount@google.com>
Wed, 10 Oct 2012 23:59:45 +0000 (16:59 -0700)
committerThe Android Automerger <android-build@android.com>
Thu, 11 Oct 2012 02:09:28 +0000 (19:09 -0700)
 Bug 7325685

Change-Id: I5e24b4f8a0ee4016c122e14702e3ae575f5bb56f

src/com/android/gallery3d/app/PhotoPage.java

index d6723ca..2e19a2b 100644 (file)
@@ -661,12 +661,14 @@ public class PhotoPage extends ActivityState implements
                 && (photo.getSupportedOperations() & MediaItem.SUPPORT_SHARE) != 0) {
             updateShareURI(photo.getPath());
         }
-        StitchingProgressManager progressManager = mApplication.getStitchingProgressManager();
-        mProgressBar.hideProgress();
-        if (progressManager != null && mCurrentPhoto instanceof LocalImage) {
-            Integer progress = progressManager.getProgress(photo.getContentUri());
-            if (progress != null) {
-                mProgressBar.setProgress(progress);
+        if (mProgressBar != null) {
+            mProgressBar.hideProgress();
+            StitchingProgressManager progressManager = mApplication.getStitchingProgressManager();
+            if (progressManager != null && mCurrentPhoto instanceof LocalImage) {
+                Integer progress = progressManager.getProgress(photo.getContentUri());
+                if (progress != null) {
+                    mProgressBar.setProgress(progress);
+                }
             }
         }
     }