Fix select invalid image null error
This commit is contained in:
1 parent
53ba692375
commit
c285562971
1 file changed
+4
@@ -115,6 +115,10 @@ public final class ImageSearchLayout extends LinearLayout implements View.OnClic
|
||||
|
||||
Context context = getContext();
|
||||
UniFile file = UniFile.fromUri(context, imageUri);
|
||||
if (null == file) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
int maxSize = context.getResources().getDimensionPixelOffset(R.dimen.image_search_max_size);
|
||||
Bitmap bitmap = BitmapUtils.decodeStream(new UniFileInputStreamPipe(file), maxSize, maxSize);
|
||||
|
||||
Reference in new issue
Block a user