diff --git a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java index 5ee6c13dc4..a51d9bed99 100644 --- a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java +++ b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java @@ -803,8 +803,9 @@ public class NiFiProperties extends Properties { } public File getKerberosConfigurationFile() { - if (getProperty(KERBEROS_KRB5_FILE).trim().length() > 0) { - return new File(getProperty(KERBEROS_KRB5_FILE)); + final String krb5File = getProperty(KERBEROS_KRB5_FILE); + if (krb5File != null && krb5File.trim().length() > 0) { + return new File(krb5File.trim()); } else { return null; }