private int isPlatformLogOn()
{
- TreeItem[] items = panel.getTreeViewer().getTree().getSelection();
+ final AtomicInteger result = new AtomicInteger(PLATFORMLOG_UNABLE);
+ Tree tree = panel.getTreeViewer().getTree();
+
+ // if no item is selected in tree, return default value;
+ if(tree.getSelectionCount() == 0)
+ {
+ return result.get();
+ }
+ TreeItem[] items = tree.getSelection();
FileEntry file = (FileEntry) items[0].getData();
IDevice[] devices = SmartDevelopmentBridge.getBridge().getDevices();
- final AtomicInteger result = new AtomicInteger(PLATFORMLOG_UNABLE);
+
for (IDevice device : devices)
{
if (file.getName().equals(device.getDeviceName()))
}
}
}
-}
\ No newline at end of file
+}