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

Commit 4a417449 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "PrintSpooler: fix monkey crash if height&width small than 0"

parents 9282d725 e54349fd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -467,6 +467,12 @@ public final class PageAdapter extends Adapter<ViewHolder> {
        loadingContent.layout(0, 0, loadingContent.getMeasuredWidth(),
                loadingContent.getMeasuredHeight());

        // To create a bitmap, height & width should be larger than 0
        if (mPageContentHeight <= 0 || mPageContentWidth <= 0) {
            Log.w(LOG_TAG, "Unable to create bitmap, height or width smaller than 0!");
            return;
        }

        Bitmap loadingBitmap = Bitmap.createBitmap(mPageContentWidth, mPageContentHeight,
                Bitmap.Config.ARGB_8888);
        loadingContent.draw(new Canvas(loadingBitmap));