bugfix: gui-dependency caused nullpointer exception in test mode

This commit is contained in:
Fredrik Osterlind 2012-05-30 14:45:36 +02:00
parent 5788560946
commit 2f757527d4

View file

@ -264,15 +264,19 @@ public class ScriptRunner extends VisPlugin {
if (source == null) { if (source == null) {
updateScript(""); updateScript("");
actionLinkFile.setMenuText("Link script to disk file"); if (actionLinkFile != null) {
actionLinkFile.putValue("JavascriptSource", null); actionLinkFile.setMenuText("Link script to disk file");
actionLinkFile.putValue("JavascriptSource", null);
}
codeEditor.setEditable(true); codeEditor.setEditable(true);
} else { } else {
updateScript(linkedFile); updateScript(linkedFile);
actionLinkFile.setMenuText("Unlink script: " + source.getName()); if (actionLinkFile != null) {
actionLinkFile.putValue("JavascriptSource", source); actionLinkFile.setMenuText("Unlink script: " + source.getName());
actionLinkFile.putValue("JavascriptSource", source);
}
codeEditor.setEditable(false); codeEditor.setEditable(false);
} }