Commit e4778b45 by app_dev@sobot.com

防止控制针异常

parent 417dceb9
...@@ -508,7 +508,7 @@ public class SobotImageUtils { ...@@ -508,7 +508,7 @@ public class SobotImageUtils {
is = contentResolver.openInputStream(uri); is = contentResolver.openInputStream(uri);
File cache = new File(context.getExternalCacheDir().getAbsolutePath(), Math.round((Math.random() + 1) * 1000) + displayName); File cache = new File(context.getExternalCacheDir().getAbsolutePath(), Math.round((Math.random() + 1) * 1000) + displayName);
fos = new FileOutputStream(cache); fos = new FileOutputStream(cache);
SobotIOUtils.copyFileWithStream(fos,is); SobotIOUtils.copyFileWithStream(fos, is);
file = cache; file = cache;
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -530,6 +530,10 @@ public class SobotImageUtils { ...@@ -530,6 +530,10 @@ public class SobotImageUtils {
} }
} }
} }
if (file == null) {
return null;
} else {
return file.getAbsolutePath(); return file.getAbsolutePath();
} }
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment