From 434ad00d88ce24785b9d9edbcd03ffa562fd8a4e Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Thu, 6 Oct 2022 10:11:35 +0200 Subject: sanitizing NULLable config values --- .../src/main/java/at/asit/pdfover/gui/utils/LocaleSerializer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/LocaleSerializer.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/LocaleSerializer.java index 18d6e8c1..5d90ae6f 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/LocaleSerializer.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/utils/LocaleSerializer.java @@ -18,6 +18,10 @@ package at.asit.pdfover.gui.utils; // Imports import java.util.Locale; +import javax.annotation.Nonnull; + +import at.asit.pdfover.commons.Constants; + /** * */ @@ -49,7 +53,7 @@ public class LocaleSerializer { * @param locale the locale * @return the parsable string */ - public static String getParsableString(Locale locale) { - return locale.toString(); + public static @Nonnull String getParsableString(Locale locale) { + return Constants.ISNOTNULL(locale.toString()); } } -- cgit v1.2.3