Skip to content

Commit e6539c3

Browse files
committed
Fixed issue with zero-length groups in Details
Signed-off-by: Grant Skinner <[email protected]>
1 parent 818b12d commit e6539c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/views/DocView.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,10 @@ p.updateTool = function (source, regex) {
632632
"<p>"+TextUtils.htmlSafe(match[0])+"</p>";
633633

634634
for (var i=1; i<match.length; i++) {
635+
var group = match[i];
635636
result += "<h1><b>Group #"+i+"</b>"+
636-
" <b>Length:</b> "+match[i].length+"</h1>"+
637-
"<p>"+TextUtils.htmlSafe(match[i])+"</p>";
637+
" <b>Length:</b> "+(group&&group.length||0)+"</h1>"+
638+
"<p>"+TextUtils.htmlSafe(group||"")+"</p>";
638639
}
639640
}
640641

0 commit comments

Comments
 (0)