Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
halirutan committed Jan 11, 2018
1 parent 885d08c commit 3e5006a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/de/halirutan/mathematica/lang/psi/util/Comments.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public static CommentStyle getStyle(@NotNull final PsiComment comment) {

public static String getStrippedText(@NotNull final PsiComment comment) {
String text = comment.getText();
assert text.length() >= 4; // we need at least this (**), should never happen!
return text.substring(2, text.length() - 2).trim();
return text != null && text.length() >= 4 ? text.substring(2, text.length() - 2).trim() : "";
}

public enum CommentStyle implements Comparable<CommentStyle> {
Expand Down

0 comments on commit 3e5006a

Please sign in to comment.