Skip to content

Commit

Permalink
MapFile: fix NPE on close
Browse files Browse the repository at this point in the history
  • Loading branch information
devemux86 committed Jun 30, 2016
1 parent 372dab3 commit 45408e7
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -238,7 +238,6 @@ public MapFile(File mapFile, String language) {

this.timestamp = mapFile.lastModified();
} catch (Exception e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
// make sure that the file is closed
closeFile();
throw new MapFileException(e.getMessage());
Expand Down Expand Up @@ -285,7 +284,9 @@ private void closeFile() {
if (this.databaseIndexCache != null) {
this.databaseIndexCache.destroy();
}
this.inputFile.close();
if (this.inputFile != null) {
this.inputFile.close();
}
} catch (Exception e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
Expand Down

0 comments on commit 45408e7

Please sign in to comment.