mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-15 10:15:03 +01:00
Fix - binding to nonexistent element
This commit is contained in:
@@ -828,6 +828,9 @@ const bindingBorderTest = (
|
|||||||
{ x, y }: { x: number; y: number },
|
{ x, y }: { x: number; y: number },
|
||||||
app: AppClassProperties,
|
app: AppClassProperties,
|
||||||
): boolean => {
|
): boolean => {
|
||||||
|
if(!element || !element.width || !element.height) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const threshold = maxBindingGap(element, element.width, element.height);
|
const threshold = maxBindingGap(element, element.width, element.height);
|
||||||
const shape = app.getElementShape(element);
|
const shape = app.getElementShape(element);
|
||||||
return isPointOnShape([x, y], shape, threshold);
|
return isPointOnShape([x, y], shape, threshold);
|
||||||
|
|||||||
Reference in New Issue
Block a user