[BUGFIX] Fixed null pointer on debug

This commit is contained in:
Jeroen Ketelaar
2019-05-13 18:22:59 -05:00
parent 87e38f51b8
commit 59d4e2fa58
@@ -160,15 +160,8 @@ public final class ScriptSelector extends JFrame {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String s = getScriptName(tree.getSelectionPath().toString()); String s = getScriptName(tree.getSelectionPath().toString());
if (s != null) {
try {
WebUtil.getContents("http://bdn.parabot.org/api/v2/scripts/local", "script=" + URLEncoder.encode(s, "UTF-8") + "&username=" + URLEncoder.encode(Context.getUsername(), "UTF-8"));
} catch (MalformedURLException | UnsupportedEncodingException e1) {
e1.printStackTrace();
}
runScript(format.get(s)); runScript(format.get(s));
} }
}
}); });
JButton cmdHome = new JButton("Open home"); JButton cmdHome = new JButton("Open home");