You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by "Anthony Carlucci (Issue Comment Edited) (JIRA)" <ji...@apache.org> on 2011/11/03 19:29:32 UTC

[jira] [Issue Comment Edited] (RAVE-331) Error when trying to upload a duplicate gadget url to widget store

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

Anthony Carlucci edited comment on RAVE-331 at 11/3/11 6:28 PM:
----------------------------------------------------------------

If you haven't modified the registerNewWidget function yet to throw the DuplicateItemException, then yes that is expected, because it returns null if it found a Widget already in the database.  The permission evaluator then denies permission on a null Widget.
                
      was (Author: carlucci):
    If you haven't modified the registerNewUser function yet to throw the DuplicateItemException, then yes that is expected, because it returns null if it found a Widget already in the database.  The permission evaluator then denies permission on a null Widget.
                  
> Error when trying to upload a duplicate gadget url to widget store
> ------------------------------------------------------------------
>
>                 Key: RAVE-331
>                 URL: https://issues.apache.org/jira/browse/RAVE-331
>             Project: Rave
>          Issue Type: Bug
>    Affects Versions: 0.5-INCUBATING
>            Reporter: Anthony Carlucci
>            Assignee: Anthony Carlucci
>            Priority: Minor
>             Fix For: 0.6-INCUBATING
>
>         Attachments: stacktrace.log
>
>
> How to Reproduce
> --------------------------
> 1) Login to Rave as any user
> 2) Upload a gadget to the widget store - verify it was added successfully
> 3) Go back and try to add the same gadget url again
> 4) You will see the standard "rave has suffered a brief meltdown" page
> The issue is that the DefaultWidgetService.registerNewWidget function returns a null Widget object if it finds the URL already in the system.  The RavePermissionEvaluator.hasPermission functions are not properly dealing with potential null objects and thus a NPE is thrown.
> How to Fix
> ----------------
> 1) Improve the RavePermissionEvaluator.hasPermission methods to check for and safely handle possible null objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira