add null protection

This commit is contained in:
Branislav Stojkovic
2019-02-02 12:47:50 +01:00
parent 46f20a75ec
commit 0741f4334b
2 changed files with 2 additions and 2 deletions
@@ -461,7 +461,7 @@ public class StatusBar extends JPanel implements IPlugIn {
statusText = "<html>Selection: " + builder.toString() + "</html>"; statusText = "<html>Selection: " + builder.toString() + "</html>";
} }
} else { } else {
if (forceInstatiate) if (forceInstatiate != null && forceInstatiate)
statusText = "<html>Drag the mouse over the canvas to place a new <font color='blue'>" + componentSlot.getName() statusText = "<html>Drag the mouse over the canvas to place a new <font color='blue'>" + componentSlot.getName()
+ "</font></html>"; + "</font></html>";
else else
@@ -51,7 +51,7 @@ class TreeGestureListener implements DragGestureListener {
if (path != null && path.getLastPathComponent() instanceof DefaultMutableTreeNode) { if (path != null && path.getLastPathComponent() instanceof DefaultMutableTreeNode) {
DefaultMutableTreeNode leaf = (DefaultMutableTreeNode)path.getLastPathComponent(); DefaultMutableTreeNode leaf = (DefaultMutableTreeNode)path.getLastPathComponent();
Payload payload = (Payload) leaf.getUserObject(); Payload payload = (Payload) leaf.getUserObject();
if (payload != null) { if (payload != null && (payload.getComponentType() != null || payload.getClickListener() != null)) {
if (payload.getComponentType() != null) if (payload.getComponentType() != null)
presenter.setNewComponentTypeSlot(payload.getComponentType(), null, true); presenter.setNewComponentTypeSlot(payload.getComponentType(), null, true);
else else