Nicolas Cannasse 17 年之前
父节点
当前提交
cfa4bdca0d
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      std/EReg.hx

+ 2 - 1
std/EReg.hx

@@ -113,7 +113,8 @@ class EReg {
 	**/
 	public function matched( n : Int ) : String {
 		#if neko
-			return new String(regexp_matched(r,n));
+			var m = regexp_matched(r,n);
+			return (m == null) ? null : new String(m);
 		#elseif js
 			return untyped if( r.m != null && n >= 0 && n < r.m.length ) r.m[n] else throw "EReg::matched";
 		#elseif flash9