crazycodeboy / TakePhoto

一款用于在Android设备上获取照片(拍照或从相册、文件中选择)、裁剪图片、压缩图片的开源工具库
http://www.devio.org/tags/#TakePhoto
Apache License 2.0
7.24k stars 1.51k forks source link

NullPointerException[v3.0.4] #78

Open piorpua opened 7 years ago

piorpua commented 7 years ago

你好,我在使用 v3.0.4 的时候,出现了空指针的崩溃。详细堆栈信息如下:

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1007, result=-1, data=Intent { typ=image/* }} to activity : java.lang.NullPointerException at android.app.ActivityThread.deliverResults(ActivityThread.java:3361) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3404) at android.app.ActivityThread.access$1300(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1248) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5011) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:832) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:648) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.jph.takephoto.uitl.TImageFiles.getMimeType(TImageFiles.java:122) at com.jph.takephoto.app.TakePhotoImpl.onCrop(TakePhotoImpl.java:267) at com.jph.takephoto.app.TakePhotoImpl.onActivityResult(TakePhotoImpl.java:110) at android.app.Activity.dispatchActivityResult(Activity.java:5433) at android.app.ActivityThread.deliverResults(ActivityThread.java:3357) ... 11 more java.lang.NullPointerException at com.jph.takephoto.uitl.TImageFiles.getMimeType(TImageFiles.java:122) at com.jph.takephoto.app.TakePhotoImpl.onCrop(TakePhotoImpl.java:267) at com.jph.takephoto.app.TakePhotoImpl.onActivityResult(TakePhotoImpl.java:110) at android.app.Activity.dispatchActivityResult(Activity.java:5433) at android.app.ActivityThread.deliverResults(ActivityThread.java:3357) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3404) at android.app.ActivityThread.access$1300(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1248) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5011) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:832) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:648) at dalvik.system.NativeStart.main(Native Method)

更新日志上没看出来是否修复,麻烦你看一下。 谢谢!

crazycodeboy commented 7 years ago

下载demo 运行一下https://github.com/crazycodeboy/TakePhoto/blob/master/simple/simple-debug.apk