From c13ba57f555050391a9fa76ddd8938d24b2a78fc Mon Sep 17 00:00:00 2001 From: Liberation <1487098940@qq.com> Date: Wed, 29 Mar 2017 11:12:23 +0800 Subject: [PATCH] Fix NullPotinterException resultList sometimes does not init, fix NullPotinterException. --- .../multi_image_selector/MultiImageSelectorActivity.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multi-image-selector/src/main/java/me/nereo/multi_image_selector/MultiImageSelectorActivity.java b/multi-image-selector/src/main/java/me/nereo/multi_image_selector/MultiImageSelectorActivity.java index 26905ca..7e0f360 100644 --- a/multi-image-selector/src/main/java/me/nereo/multi_image_selector/MultiImageSelectorActivity.java +++ b/multi-image-selector/src/main/java/me/nereo/multi_image_selector/MultiImageSelectorActivity.java @@ -158,6 +158,10 @@ public void onImageSelected(String path) { @Override public void onImageUnselected(String path) { + // resultList sometimes does not init fix NullPotinterException + if(resultList==null){ + resultList = new ArrayList<>(); + } if(resultList.contains(path)){ resultList.remove(path); }