fix to JSRegexp
[org.ibex.js.git] / src / org / ibex / js / JSRegexp.java
index aa68c2f..25b890f 100644 (file)
@@ -110,6 +110,7 @@ public class JSRegexp extends JS.Immutable {
     }
   
     private static JS matchToExecResult(GnuRegexp.REMatch match, GnuRegexp.RE re, String s) {
+        if (match == null) return null;
         try {
             JS ret = new JS.Obj();
             ret.put(JSU.S("index"), JSU.N(match.getStartIndex()));