From: Florian Zschocke Date: Mon, 31 Oct 2022 21:38:06 +0000 (+0100) Subject: fix: Fix null pointer exception in FileSettings X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1433%2Fhead;p=gitblit.git fix: Fix null pointer exception in FileSettings Fix a null pointer access in the `toString` method for a freshly created `FileSettings`. --- diff --git a/src/main/java/com/gitblit/FileSettings.java b/src/main/java/com/gitblit/FileSettings.java index 3caf966b..24d86d30 100644 --- a/src/main/java/com/gitblit/FileSettings.java +++ b/src/main/java/com/gitblit/FileSettings.java @@ -227,6 +227,9 @@ public class FileSettings extends IStoredSettings { @Override public String toString() { + if (propertiesFile == null) { + return "[empty]"; + } return propertiesFile.getAbsolutePath(); } }