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

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

Fix possible exception in default live wallpaper

parent 2b7d44ed
Loading
Loading
Loading
Loading
+27 −23
Original line number Diff line number Diff line
@@ -99,7 +99,9 @@ public class ImageWallpaper extends WallpaperService {
        
        void drawFrame(boolean drawText) {
            SurfaceHolder sh = getSurfaceHolder();
            Canvas c = sh.lockCanvas();
            Canvas c = null;
            try {
                c = sh.lockCanvas();
                if (c != null) {
                    final Rect frame = sh.getSurfaceFrame();
                    mBackground.setBounds(frame);
@@ -124,7 +126,9 @@ public class ImageWallpaper extends WallpaperService {
                                frame.top + (frame.bottom-frame.top)/2, mTextPaint);
                    }
                }
            sh.unlockCanvasAndPost(c);
            } finally {
                if (c != null) sh.unlockCanvasAndPost(c);
            }
        }
    }