Merge pull request #5144 from pacoelayudante/patch-1

make "loadXML(String)" handle "file not found"
This commit is contained in:
Ben Fry
2018-03-26 19:15:57 -04:00
committed by GitHub

View File

@@ -5922,7 +5922,12 @@ public class PApplet implements PConstants {
*/
public XML loadXML(String filename, String options) {
try {
return new XML(createReader(filename), options);
BufferedReader br = createReader(filename);
if (br != null) {
return new XML(br, options);
} else {
br = null;
}
// can't use catch-all exception, since it might catch the
// RuntimeException about the incorrect case sensitivity