mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-23 04:11:54 -04:00
fixes a NullPointerException
This commit is contained in:
parent
bc0e7a87e0
commit
f6f457ffa4
@ -1542,6 +1542,8 @@ public class CircuitComponent extends JComponent implements ChangedListener, Lib
|
||||
}
|
||||
|
||||
private boolean wasMoved(MouseEvent e) {
|
||||
if (pos == null) // seems to happen in very rare cases
|
||||
return false;
|
||||
Vector d = new Vector(e.getX(), e.getY()).sub(pos);
|
||||
return Math.abs(d.x) > DRAG_DISTANCE || Math.abs(d.y) > DRAG_DISTANCE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user