From 22e153177ccc0bae2c5a811751b9e37aa8a66ee9 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Tue, 12 Nov 2019 09:38:04 +0100 Subject: [PATCH] Fix NPE in SystemReader in tests SystemReader.updateAll() must _not_ test whether the file exists. In tests at least there are FileBasedConfigs with a null file. Test configs should (and do) override isOutdated() to deal with this case. Change-Id: I56303fe0d56afeb9f2203ee807a92c5dcf3809e9 Signed-off-by: Thomas Wolf --- org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java index 59184ffda..e16a88655 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java @@ -428,9 +428,6 @@ public abstract class SystemReader { updateAll(config.getBaseConfig()); if (config instanceof FileBasedConfig) { FileBasedConfig cfg = (FileBasedConfig) config; - if (!cfg.getFile().exists()) { - return; - } if (cfg.isOutdated()) { LOG.debug("loading config {}", cfg); //$NON-NLS-1$ cfg.load();