Skip to content
Snippets Groups Projects
Commit 24777c59 authored by Stephane Dallongeville's avatar Stephane Dallongeville
Browse files

fixed possible NPE

parent 69095d0d
No related branches found
No related tags found
No related merge requests found
...@@ -331,12 +331,16 @@ public class WorkFlowPanel extends BlockPanel implements VarVisibilityListener ...@@ -331,12 +331,16 @@ public class WorkFlowPanel extends BlockPanel implements VarVisibilityListener
if (blockDesc.isCollapsed()) if (blockDesc.isCollapsed())
return; return;
DragDropZone dz = varDropZones.get(variable); DragDropZone dz = getP1Zone();
int y = dz.getLocationOnScreen().y;
int offsetY = getLocationOnScreen().y; if (dz != null)
{
int y = dz.getLocationOnScreen().y;
int offsetY = getLocationOnScreen().y;
x1 = dz.getWidth(); x1 = dz.getWidth();
y1 = y - offsetY + dz.getHeight() / 2; y1 = y - offsetY + dz.getHeight() / 2;
}
} }
@Override @Override
......
...@@ -120,12 +120,12 @@ public abstract class Line extends Line2D.Float implements ComponentListener, Mo ...@@ -120,12 +120,12 @@ public abstract class Line extends Line2D.Float implements ComponentListener, Mo
if (p1z != null) if (p1z != null)
p1z.addMouseListener(this); p1z.addMouseListener(this);
else // else
System.err.print("source drag zone null !"); // System.err.print("source drag zone null !");
if (p2z != null) if (p2z != null)
p2z.addMouseListener(this); p2z.addMouseListener(this);
else // else
System.err.print("destination drop zone null !"); // System.err.print("destination drop zone null !");
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment