瀏覽代碼

[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>
tags/v4.4.0.201605250940-rc1
Matthias Sohn 8 年之前
父節點
當前提交
3652887108
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java

+ 1
- 1
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);
}
}

Loading…
取消
儲存