Bug fix: ProjectRspMsg.config is optional and can be null while loading a project

This commit is contained in:
dcollin 2015-11-13 16:12:33 +01:00
parent b5e56ca2bf
commit edf5d445e5

View file

@ -78,17 +78,23 @@ public class EditorWindow extends GuiWindow {
//handle config //handle config
propertySheet.getItems().clear(); propertySheet.getItems().clear();
Enumeration<String> propertyNames = (Enumeration<String>) msg.config.propertyNames(); if(msg.config != null){
while(propertyNames.hasMoreElements()){ //populate propertySheet with all config elements logger.fine("the project has a configuration - populating property sheet");
String propertyName = propertyNames.nextElement(); Enumeration<String> propertyNames = (Enumeration<String>) msg.config.propertyNames();
String propertyValue = msg.config.getProperty(propertyName); while(propertyNames.hasMoreElements()){ //populate propertySheet with all config elements
ComboBoxProperty comboProperty = new ComboBoxProperty(propertyName, propertyValue, null); String propertyName = propertyNames.nextElement();
propertySheet.getItems().add(comboProperty); 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 //request alternative values for config of this project type
projectType = msg.type; projectType = msg.type;
sendProjectTypeReqMsg(projectType); sendProjectTypeReqMsg(projectType);
}else{
logger.fine("the project has no configuration");
}
//handle file list //handle file list
List<String> fileList = msg.fileList; List<String> fileList = msg.fileList;