Skip to content

Commit 60db1f9

Browse files
authored
Merge pull request processing#5144 from pacoelayudante/patch-1
make "loadXML(String)" handle "file not found"
2 parents 4b0a9b1 + 1798e90 commit 60db1f9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

core/src/processing/core/PApplet.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5922,7 +5922,12 @@ public XML loadXML(String filename) {
59225922
*/
59235923
public XML loadXML(String filename, String options) {
59245924
try {
5925-
return new XML(createReader(filename), options);
5925+
BufferedReader br = createReader(filename);
5926+
if (br != null) {
5927+
return new XML(br, options);
5928+
} else {
5929+
br = null;
5930+
}
59265931

59275932
// can't use catch-all exception, since it might catch the
59285933
// RuntimeException about the incorrect case sensitivity

0 commit comments

Comments
 (0)