ofbiz-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deepak Dixit (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OFBIZ-6219) NPE while rendering content uisng screen widget
Date Fri, 27 Mar 2015 13:26:52 GMT

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

Deepak Dixit commented on OFBIZ-6219:
-------------------------------------

If we add condition in single if block then if content exists but dataResouceId is null then
condition fails and is will return error with error message "Could not find content with contentId
[" + expandedContentId + "] ";

Here is the original code 
{code}
                    if (content != null) {
                        expandedDataResourceId = content.getString("dataResourceId");
                    } else {
                        String errMsg = "Could not find content with contentId [" + expandedContentId
+ "] ";
                        Debug.logError(errMsg, module);
                        throw new RuntimeException(errMsg);
                    }
{code}

> NPE while rendering content uisng screen widget
> -----------------------------------------------
>
>                 Key: OFBIZ-6219
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6219
>             Project: OFBiz
>          Issue Type: Bug
>          Components: content, framework
>    Affects Versions: Release Branch 14.12, Trunk
>            Reporter: Deepak Dixit
>         Attachments: OFBIZ-6219.patch, OFBIZ-6219.patch, OFBIZ-6219.patch
>
>
> If we want to render an content that does't have dataResourceId then screen widget throwing
NPE
> {code}
> Caused by: java.lang.NullPointerException
> 	at org.ofbiz.widget.model.ModelScreenWidget$Content.renderWidgetString(ModelScreenWidget.java:1399)
~[ofbiz-widget.jar:?]
> 	at org.ofbiz.widget.model.ModelScreenWidget.renderSubWidgetsString(ModelScreenWidget.java:98)
~[ofbiz-widget.jar:?]
> 	at org.ofbiz.widget.model.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:280)
~[ofbiz-widget.jar:?]
> 	at org.ofbiz.widget.model.ModelScreen.renderScreenString(ModelScreen.java:164) ~[ofbiz-widget.jar:?]
> 	at org.ofbiz.widget.renderer.ScreenRenderer.render(ScreenRenderer.java:136) ~[ofbiz-widget.jar:?]
> 	at org.ofbiz.widget.renderer.ScreenRenderer.render(ScreenRenderer.java:98) ~[ofbiz-widget.jar:?]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message