Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaneberly committed Sep 15, 2018
1 parent 21e5649 commit 617162e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/com/cflint/CFLint.java
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,9 @@ public void reportRule(Element elem, Object currentExpression, final Context con
bugInfo.setLine(msg.getLine());
if (msg.getOffset() != null) {
bugInfo.setOffset(msg.getOffset());
bugInfo.setColumn(msg.getOffset() - lineOffsets[msg.getLine() - idxOffSet]);
try{
bugInfo.setColumn(msg.getOffset() - lineOffsets[msg.getLine() - idxOffSet]);
}catch(ArrayIndexOutOfBoundsException aie){bugInfo.setColumn(0);}
} else {
bugInfo.setOffset(lineOffsets != null ? lineOffsets[msg.getLine() - idxOffSet] : 0);
bugInfo.setColumn(0);
Expand All @@ -1417,7 +1419,9 @@ public void reportRule(Element elem, Object currentExpression, final Context con
bug.setLine(msg.getLine());
if (msg.getOffset() != null) {
bug.setOffset(msg.getOffset());
bug.setColumn(msg.getOffset() - lineOffsets[msg.getLine() - idxOffSet]);
try{
bug.setColumn(msg.getOffset() - lineOffsets[msg.getLine() - idxOffSet]);
}catch(ArrayIndexOutOfBoundsException aie){bug.setColumn(0);}
} else {
bug.setOffset(lineOffsets != null ? lineOffsets[msg.getLine() - idxOffSet] : 0);
bug.setColumn(0);
Expand Down

0 comments on commit 617162e

Please sign in to comment.