Bug 1883544 - Check whether drag image is valid. r=geckoview-reviewers,amejiamarmol

I don't know how to reproduce this.

But according to the reason of `IllegalStateException`, the drop shadow seems
to be negative or 0.

So I would like to add a check whether the image is valid.

Differential Revision: https://phabricator.services.mozilla.com/D203575
This commit is contained in:
Makoto Kato 2024-03-06 10:29:52 +00:00
parent 05da7fdeee
commit 383afe941b

View file

@ -42,7 +42,11 @@ public class GeckoDragAndDrop {
private final Bitmap mBitmap;
public DrawDragImage(final Bitmap bitmap) {
mBitmap = bitmap;
if (bitmap != null && bitmap.getWidth() > 0 && bitmap.getHeight() > 0) {
mBitmap = bitmap;
return;
}
mBitmap = null;
}
@Override