Skip to content

Commit

Permalink
fix "Cannot read property text of undefined"
Browse files Browse the repository at this point in the history
  • Loading branch information
levity committed Oct 3, 2016
1 parent 10d00e6 commit 764cec0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/html/annotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function annotateStatements(fileCoverage, structuredText) {
closeSpan = lt + '/span' + gt,
text;

if (type === 'no') {
if (type === 'no' && structuredText[startLine]) {
if (endLine !== startLine) {
endLine = startLine;
endCol = structuredText[startLine].text.originalLength();
Expand Down Expand Up @@ -88,7 +88,7 @@ function annotateFunctions(fileCoverage, structuredText) {
closeSpan = lt + '/span' + gt,
text;

if (type === 'no') {
if (type === 'no' && structuredText[startLine]) {
if (endLine !== startLine) {
endLine = startLine;
endCol = structuredText[startLine].text.originalLength();
Expand Down Expand Up @@ -143,7 +143,7 @@ function annotateBranches(fileCoverage, structuredText) {
+ title('branch not covered') + gt;
closeSpan = lt + '/span' + gt;

if (count === 0) { //skip branches taken
if (count === 0 && structuredText[startLine]) { //skip branches taken
if (endLine !== startLine) {
endLine = startLine;
endCol = structuredText[startLine].text.originalLength();
Expand Down

0 comments on commit 764cec0

Please sign in to comment.