diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 7d5deb249..4ca70ed28 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -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