Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c529d8d8 authored by Romain Guy's avatar Romain Guy
Browse files

Prevent crash in View.createSnapshot if getResources() returns null

Bug #5260241

Change-Id: I90b6d5a8961a6b7b50603a9f59a6e39093646bd4
parent 3b19b5ec
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -10320,7 +10320,10 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit
            throw new OutOfMemoryError();
        }
        bitmap.setDensity(getResources().getDisplayMetrics().densityDpi);
        Resources resources = getResources();
        if (resources != null) {
            bitmap.setDensity(resources.getDisplayMetrics().densityDpi);
        }
        Canvas canvas;
        if (attachInfo != null) {