From 6948304f6919e81b75b5a1fa9f86d783e9fb87dd Mon Sep 17 00:00:00 2001 From: Kedi Xu Date: Fri, 2 Sep 2016 14:05:18 +0800 Subject: SnapdragonGallery: Fix crash mModel is null in monkeytest Check mModel isn't null before use. Change-Id: I5e0edecf18561f90d913844b44a314c79b2b66fe CRs-Fixed: 1062647 --- src/com/android/gallery3d/app/PhotoPage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index fdcb573bb..3000d056b 100755 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -1415,7 +1415,9 @@ public abstract class PhotoPage extends ActivityState implements mActivity.getStateManager().startState(SinglePhotoPage.class, data); return; } - mModel.setCurrentPhoto(path, mCurrentIndex); + if (null != mModel) { + mModel.setCurrentPhoto(path, mCurrentIndex); + } } } -- cgit v1.2.3