mTarget can be null in CanvasRenderingContext2D::ClearRect(), return early if so.

This commit is contained in:
2023-12-26 09:30:24 +08:00
parent 30ef545b4e
commit 13e8a4e26a
+1 -1
View File
@@ -2528,7 +2528,7 @@ CanvasRenderingContext2D::ClearRect(double aX, double aY, double aW,
double aH)
{
// Do not allow zeros - it's a no-op at that point per spec.
if (!ValidateRect(aX, aY, aW, aH, false)) {
if (!mTarget || !ValidateRect(aX, aY, aW, aH, false)) {
return;
}