Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-19508

DisplayUser velocity macro is crashing when used with a null value

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      The macros.vm expose a #displayUser velocity macro that can be used for displaying a user. However this macro seems to not support providing a null value, which is a common usecase with Guest user, since it's internally stored as null.
      Moreover, the interpretation of an empty string is a bit surprising. IMO it should resolve both null and empty string to display Guest user information.

      Reproduction steps:

      • Create a page with:
        {{velocity}}
        #displayUser()
        {{/velocity}}
        

      Expected result:

      • the macro displays Guest user

      Obtained result:

      • a NPE

      Attachments

        Issue Links

          Activity

            People

              surli Simon Urli
              surli Simon Urli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: