Skip to content

Commit

Permalink
Ensure streams are available before closing
Browse files Browse the repository at this point in the history
  • Loading branch information
strazzere committed Oct 19, 2015
1 parent 098564a commit 819ddd6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/diff/rednaga/AXMLPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ public static void main(String[] arguments) throws IOException {
} catch (Exception e) {
e.printStackTrace();
} finally {
fileInputStream.close();
fileOutputStream.close();
if (fileInputStream != null) {
fileInputStream.close();
}

if (fileOutputStream != null) {
fileOutputStream.close();
}
}
}

Expand Down

0 comments on commit 819ddd6

Please sign in to comment.