Skip to content

Commit

Permalink
fix(android): crash when rotating screen in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
iPel authored and hippy-actions[bot] committed Nov 20, 2023
1 parent e7b8241 commit 611fd58
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private static void callbackScreenShot(View view, Bitmap bitmap, float scale, in
}

private static String bitmapToBase64Str(Bitmap bitmap, float scale, int viewWidth, int viewHeight) {
String result = null;
String result = "";
ByteArrayOutputStream outputStream = null;
try {
if (bitmap != null) {
Expand All @@ -269,6 +269,8 @@ private static String bitmapToBase64Str(Bitmap bitmap, float scale, int viewWidt
byte[] bitmapBytes = outputStream.toByteArray();
result = Base64.encodeToString(bitmapBytes, Base64.NO_WRAP);
}
} catch (IllegalArgumentException e) {
sCacheBitmapRef.clear();
} catch (IOException e) {
LogUtils.e(TAG, "bitmapToBase64Str, scale exception:", e);
} finally {
Expand Down

0 comments on commit 611fd58

Please sign in to comment.