Skip to content

Commit

Permalink
Fixed NPE in TextFileDetector.isTextFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloyan-raev committed Nov 2, 2015
1 parent e75b632 commit aeb8f81
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public static boolean isTextFile(InputStream is) throws IOException {

// The file is text if a charset with confidence of at least 10 (out
// of 100) is detected. Empty files have confidence 10 for UTF-8.
return match.getConfidence() >= 10;
return match != null && match.getConfidence() >= 10;
}

/**
Expand Down

0 comments on commit aeb8f81

Please sign in to comment.