diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2016-05-19 15:04:46 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-05-19 15:04:46 +0200 |
commit | 36528871085b6cbbd7cc8f607155d07b44eaae51 (patch) | |
tree | 926803ea08ced81fa4922c7c8a68127c42b13863 | |
parent | c54ff8bf123835e1e9592fcef799bafce9423a94 (diff) | |
download | jgit-36528871085b6cbbd7cc8f607155d07b44eaae51.tar.gz jgit-36528871085b6cbbd7cc8f607155d07b44eaae51.zip |
[findBugs] Prevent potential NPE in FS_POSIX.readUmask()
BufferedReader.readLine() returns null if the end of the stream has been
reached.
Change-Id: I83102bbfb1316407247e0f29023077af9e8d9606
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java index 779b10e1bb..b4f12f4120 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java @@ -122,7 +122,7 @@ public class FS_POSIX extends FS { .defaultCharset().name()))) { if (p.waitFor() == 0) { String s = lineRead.readLine(); - if (s.matches("0?\\d{3}")) { //$NON-NLS-1$ + if (s != null && s.matches("0?\\d{3}")) { //$NON-NLS-1$ return Integer.parseInt(s, 8); } } |