We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

findObjectUnderMouse eventArg is null

Hello,
I am experiencing this error when connecting two ports. I have looked into source code and it would be great if ejs library would null check eventArg value


ERROR TypeError: Cannot set property 'actualObject' of null
    at ObjectFinder.findObjectUnderMouse (ej2-diagrams.es2015.js:24520)
    at DiagramEventHandler.findObjectUnderMouse (ej2-diagrams.es2015.js:24045)
    at ComponentBase.findObjectUnderMouse (ej2-diagrams.es2015.js:30780)
    at DiagramEventHandler.mouseMove (ej2-diagrams.es2015.js:23038)
    at ZoneDelegate.invokeTask (zone-evergreen.js:400)
    at Object.onInvokeTask (core.js:39680)
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Zone.runTask (zone-evergreen.js:168)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:481)
    at invokeTask (zone-evergreen.js:1596)


Problematic source code

  if ((action === 'ConnectorSourceEnd' && source || action === 'PortDraw') ||
                ((canDrawOnce(diagram) || canContinuousDraw(diagram)) && getObjectType(diagram.drawingObject) === Connector)) {
                let connector = diagram.selectedItems.connectors[0];
                for (let i = objects.length - 1; i >= 0; i--) {
                    outPort = getInOutConnectPorts(objects[i], false);
                    if (objects[i] instanceof Node && (canOutConnect(objects[i]) || (canPortOutConnect(outPort)))) {
                        actualTarget = objects[i];
                        if (connector) {
                            actualTarget = this.isTarget(actualTarget, diagram, action);
                        }
                        eventArg.actualObject = actualTarget;
                        return actualTarget;
                    }
                }
            }

1 Reply

SG Shyam G Syncfusion Team December 20, 2019 05:28 AM UTC

Hi Gabo, 

We have checked your issue in our sample and we are unable to replicate an issue at our end. Please share us more details such as exact use case to replicate an issue or modify the below sample. 


Regards, 
Shyam G 


Loader.
Live Chat Icon For mobile
Up arrow icon