mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
add null protection
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user