Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Fix NPE while making the screenshot bitmap mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
nkming2 committed Oct 29, 2018
1 parent 048f819 commit 22d047e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ public static void startCalibration(@NonNull Context context,
sCalibrationImage = bitmap;
} else {
// Make a mutable copy of the bitmap so we can draw on it with a Canvas
sCalibrationImage = bitmap.copy(sCalibrationImage.getConfig() ,true);
sCalibrationImage = bitmap.copy(Bitmap.Config.ARGB_8888 ,true);
if (sCalibrationImage == null) {
Timber.e("The screenshot bitmap is converted to null, can't proceed");
return;
}
}

if (!sCalibrationImage.isMutable()) {
Expand Down

0 comments on commit 22d047e

Please sign in to comment.