Catch potential IOExceptions
This commit is contained in:
parent
434f2e59d9
commit
05f2a0be85
|
@ -144,13 +144,19 @@ public class GroovyPad extends JFrame {
|
||||||
return new RTextScrollPane(output, true);
|
return new RTextScrollPane(output, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FileLocation getFileLocation(String name) throws IOException {
|
protected FileLocation getFileLocation(String name) {
|
||||||
File pad = ApplicationFolder.AppData.resolve(name);
|
try {
|
||||||
if (!pad.exists()) {
|
|
||||||
// use this default value so people can easily submit bug reports with fn:sysinfo logs
|
// use this default value so people can easily submit bug reports with fn:sysinfo logs
|
||||||
ScriptShellMethods.saveAs(DEFAULT_SCRIPT, pad);
|
File pad = ApplicationFolder.AppData.resolve(name);
|
||||||
|
|
||||||
|
if (!pad.exists()) {
|
||||||
|
ScriptShellMethods.saveAs(DEFAULT_SCRIPT, pad);
|
||||||
|
return FileLocation.create(pad);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
debug.log(Level.WARNING, e, e::toString);
|
||||||
}
|
}
|
||||||
return FileLocation.create(pad);
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final ScriptShell shell;
|
protected final ScriptShell shell;
|
||||||
|
|
Loading…
Reference in New Issue