Skip to content

Commit cb7ef83

Browse files
committed
more bulletproofing around sketch naming system
1 parent 443fd89 commit cb7ef83

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

app/src/processing/app/SketchName.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ static File nextFolder(File parentDir) {
3333
String approach = Preferences.get("sketch.name.approach");
3434
if ((approach != null) && !CLASSIC.equals(approach)) {
3535
WordList wl = getWordLists().get(approach);
36-
//File folder = wordsFolder(parentDir, approach);
37-
File folder = wl.wordsFolder(parentDir);
38-
if (folder == null) {
39-
Messages.showWarning("Out of Options", """
40-
All possible naming combinations have been used.
41-
Use “Preferences” to choose a different naming system,
42-
or restart Processing.""");
36+
if (wl != null) { // just in case the naming scheme no longer available
37+
File folder = wl.wordsFolder(parentDir);
38+
if (folder == null) {
39+
Messages.showWarning("Out of Options", """
40+
All possible naming combinations have been used.
41+
Use “Preferences” to choose a different naming system,
42+
or restart Processing.""");
43+
}
44+
return folder; // null or otherwise
4345
}
44-
return folder; // null or otherwise
4546
}
4647
// classic was selected, or fallback due to an error
4748
return classicFolder(parentDir);

0 commit comments

Comments
 (0)