Issue #1650 - Add null check.

There are situations where nsCSSClipPathinstance->CreateClipPath(dt)
returns null. We need to check for this before trying to use its
functions. If there is no clip path, then always return "no hit".
This commit is contained in:
Moonchild 2020-09-12 20:20:02 +02:00 committed by roytam1
commit dc12585a82

View file

@ -59,7 +59,7 @@ nsCSSClipPathInstance::HitTestBasicShapeClip(nsIFrame* aFrame,
RefPtr<Path> path = instance.CreateClipPath(drawTarget);
float pixelRatio = float(nsPresContext::AppUnitsPerCSSPixel()) /
aFrame->PresContext()->AppUnitsPerDevPixel();
return path->ContainsPoint(ToPoint(aPoint) * pixelRatio, Matrix());
return path ? path->ContainsPoint(ToPoint(aPoint) * pixelRatio, Matrix()) : false;
}
already_AddRefed<Path>