Fix potential NPE in DocIndexer

Change-Id: Iba859bc5b6122671990e5c7af5e72ee69f57f96d
This commit is contained in:
David Pursehouse
2013-10-15 11:05:14 +09:00
parent a89b53acb3
commit 550ba8a8b6

View File

@@ -89,7 +89,7 @@ public class DocIndexer {
BufferedReader titleReader = new BufferedReader(
new InputStreamReader(new FileInputStream(file), "UTF-8"));
String title = titleReader.readLine();
if (title.startsWith("[[")) {
if (title != null && title.startsWith("[[")) {
// Generally the first line of the txt is the title. In a few cases the
// first line is a "[[tag]]" and the second line is the title.
title = titleReader.readLine();