False positive on S2583, in condition inside a try/catch block

SonarQube
Version 7.0 (build 36138)
Java code sample:

    ConfigurationConstant toGlobalConfigConstant(Enum key) {
        try {
            return ConfigurationConstant.valueOf(key.name());
        } catch (Exception ex) {
            String keyName = key != null ? key.name() : "null";    
            // ^ Change this condition so that it does not always evaluate to "true"
            logger.warn("toGlobalConfigConstant(" + keyName + ") - Invalid constant name: ", ex);
            return null;
        }
    }

If the key parameter is null, a NPE is thrown and it will still be null inside the catch block. We need to protect the access to key. I’ve checked it with a unit test.

Hello José

Could you share a full compilable reproducer indicating where you believe a False Positive is raised and share SonarJava version used to analyze the code?

Michal