From edf5d445e50b320faad0ea45967e9871d1ff8d41 Mon Sep 17 00:00:00 2001 From: dcollin Date: Fri, 13 Nov 2015 16:12:33 +0100 Subject: [PATCH] Bug fix: ProjectRspMsg.config is optional and can be null while loading a project --- .../coder/client/gui/editor/EditorWindow.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/com/coder/client/gui/editor/EditorWindow.java b/src/com/coder/client/gui/editor/EditorWindow.java index 1634936..61fadf9 100644 --- a/src/com/coder/client/gui/editor/EditorWindow.java +++ b/src/com/coder/client/gui/editor/EditorWindow.java @@ -78,18 +78,24 @@ public class EditorWindow extends GuiWindow { //handle config propertySheet.getItems().clear(); - Enumeration propertyNames = (Enumeration) msg.config.propertyNames(); - while(propertyNames.hasMoreElements()){ //populate propertySheet with all config elements - String propertyName = propertyNames.nextElement(); - String propertyValue = msg.config.getProperty(propertyName); - ComboBoxProperty comboProperty = new ComboBoxProperty(propertyName, propertyValue, null); - propertySheet.getItems().add(comboProperty); + if(msg.config != null){ + logger.fine("the project has a configuration - populating property sheet"); + Enumeration propertyNames = (Enumeration) msg.config.propertyNames(); + while(propertyNames.hasMoreElements()){ //populate propertySheet with all config elements + String propertyName = propertyNames.nextElement(); + String propertyValue = msg.config.getProperty(propertyName); + ComboBoxProperty comboProperty = new ComboBoxProperty(propertyName, propertyValue, null); + propertySheet.getItems().add(comboProperty); + } + + //request alternative values for config of this project type + projectType = msg.type; + sendProjectTypeReqMsg(projectType); + + }else{ + logger.fine("the project has no configuration"); } - //request alternative values for config of this project type - projectType = msg.type; - sendProjectTypeReqMsg(projectType); - //handle file list List fileList = msg.fileList; fileTreeView.getRoot().getChildren().clear();