From cd6e9e4b6f80de0bf41cb4ff95becfdc7a764d04 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Mar 25 2019 16:59:03 +0000 Subject: Fix bad Fx connection crash (#2554) --- diff --git a/toonz/sources/toonzqt/fxselection.cpp b/toonz/sources/toonzqt/fxselection.cpp index b93da1e..20e03ef 100644 --- a/toonz/sources/toonzqt/fxselection.cpp +++ b/toonz/sources/toonzqt/fxselection.cpp @@ -417,6 +417,7 @@ Link FxSelection::getBoundingFxs(SchematicLink *link) { Link FxSelection::getBoundingFxs(SchematicPort *inputPort, SchematicPort *outputPort) { Link boundingFxs; + if (!inputPort || !outputPort) return boundingFxs; FxSchematicNode *inputNode = dynamic_cast(outputPort->getNode()); FxSchematicNode *outputNode = diff --git a/toonz/sources/toonzqt/schematicnode.cpp b/toonz/sources/toonzqt/schematicnode.cpp index b53c62f..16cd342 100644 --- a/toonz/sources/toonzqt/schematicnode.cpp +++ b/toonz/sources/toonzqt/schematicnode.cpp @@ -564,6 +564,12 @@ void SchematicLink::mousePressEvent(QGraphicsSceneMouseEvent *me) { QPointF pos = me->scenePos(); SchematicPort *startPort = getStartPort(); SchematicPort *endPort = getEndPort(); + + if (!startPort || !endPort) { + me->ignore(); + return; + } + if (startPort && endPort) { QRectF startRect = startPort->boundingRect(); startRect.moveTopLeft(startPort->scenePos());