Browse Source

Fix trim might cause NPE in PropertyUtils (#13853)

Wenjun Ruan 2 years ago
parent
commit
69fc217ab2

+ 3 - 0
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/PropertyUtils.java

@@ -88,6 +88,9 @@ public class PropertyUtils {
      * @return property value
      */
     public static String getString(String key) {
+        if (key == null) {
+            return null;
+        }
         return properties.getProperty(key.trim());
     }