2003/11/13 09:15:11
[org.ibex.core.git] / src / org / xwt / Template.java
index 9a324d2..4cd3851 100644 (file)
@@ -280,7 +280,9 @@ public class Template {
         private JSFunction parseScript(boolean isstatic) {
             JSFunction thisscript = null;
             try {
-                thisscript = JS.parse(t.fileName + (isstatic ? "._" : ""), t.content_start, new StringReader(t.content.toString()));
+                String contentString = t.content.toString();
+                if (contentString.trim().length() > 0)
+                    thisscript = JS.parse(t.fileName + (isstatic ? "._" : ""), t.content_start, new StringReader(contentString));
             } catch (IOException ioe) {
                 if (Log.on) Log.log(this, "  ERROR: " + ioe.getMessage());
                 thisscript = null;