OSDN Git Service

Fix for monkey-generated NPE in PhotoView from bug 6848371
authorBobby Georgescu <georgescu@google.com>
Wed, 25 Jul 2012 17:20:19 +0000 (10:20 -0700)
committerBobby Georgescu <georgescu@google.com>
Wed, 25 Jul 2012 17:20:19 +0000 (10:20 -0700)
 In other parts of the code, there are checks for getGLRoot
 returning null, and one was missing here.

 Bug: 6848371

Change-Id: I3a7a1e1ea9847a43f4791de84f5f70cc27d53a1a

src/com/android/gallery3d/ui/PhotoView.java

index e44905d..2525433 100644 (file)
@@ -1565,6 +1565,7 @@ public class PhotoView extends GLView {
 
     public boolean switchWithCaptureAnimation(int offset) {
         GLRoot root = getGLRoot();
+        if(root == null) return false;
         root.lockRenderThread();
         try {
             return switchWithCaptureAnimationLocked(offset);