You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Kay-Uwe Moosheimer (JIRA)" <ji...@apache.org> on 2017/09/07 17:39:00 UTC

[jira] [Comment Edited] (NIFI-4348) isExpressionLanguagePresent throws NPE when attribute is null

    [ https://issues.apache.org/jira/browse/NIFI-4348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16157296#comment-16157296 ] 

Kay-Uwe Moosheimer edited comment on NIFI-4348 at 9/7/17 5:38 PM:
------------------------------------------------------------------

java.lang.NullPointerException
        at org.apache.nifi.attribute.expression.language.StandardPropertyValue.isExpressionLanguagePresent(*StandardPropertyValue.java:204*)

Possible fix:
return (isSet() && preparedQuery.isExpressionLanguagePresent());


was (Author: moosheimer):
java.lang.NullPointerException
        at org.apache.nifi.attribute.expression.language.StandardPropertyValue.isExpressionLanguagePresent(*StandardPropertyValue.java:204*)

Prossible fix:
return (isSet() && preparedQuery.isExpressionLanguagePresent());

> isExpressionLanguagePresent throws NPE when attribute is null
> -------------------------------------------------------------
>
>                 Key: NIFI-4348
>                 URL: https://issues.apache.org/jira/browse/NIFI-4348
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>    Affects Versions: 1.3.0
>            Reporter: Kay-Uwe Moosheimer
>            Priority: Trivial
>
> The following code throws a NPE:
>     PropertyValue property = context.getProperty(SOME_PROPERTY);
>     if (property.isExpressionLanguagePresent()) {
> when the property is not set (NULL).
> So I have to write
>     PropertyValue property = context.getProperty(SOME_PROPERTY);
>     if (property.isSet() && property.isExpressionLanguagePresent()) {    
> It would be great if the method isExpressionLanguagePresent() checks for NULL and then return false.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)