From 6deb2058486e26619120132d4658473f71da3f68 Mon Sep 17 00:00:00 2001 From: Florian Zschocke Date: Mon, 31 Oct 2022 22:38:06 +0100 Subject: [PATCH] fix: Fix null pointer exception in FileSettings Fix a null pointer access in the `toString` method for a freshly created `FileSettings`. --- src/main/java/com/gitblit/FileSettings.java | 3 +++ 1 file changed, 3 insertions(+) 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(); } } -- 2.39.5