Merge "Fix NPE due to progress bar not existing." into gb-ub-photos-arches
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index d6723ca..2e19a2b 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -661,12 +661,14 @@
                 && (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);
+                }
             }
         }
     }