Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5056

I18nNodeWrapper should throw PathNotFoundException if the property doesn't exist

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Neutral
    • None
    • 4.5.7
    • core

    Description

      To follow the contract of Node.getProperty() it must not return null. When it does this leads to a NPE.

      Here's a stacktrace for attempting to find a missing mgnl:template property.

      Caused by: java.lang.NullPointerException
      at info.magnolia.jcr.wrapper.DelegatePropertyWrapper.getString(DelegatePropertyWrapper.java:163)
      at info.magnolia.cms.core.MetaData.getStringProperty(MetaData.java:408)
      at info.magnolia.cms.core.MetaData.getTemplate(MetaData.java:322)

      In 4.5 the call ends up in info.magnolia.cms.core.NonExistingNodeData#getJCRProperty() which always returns null.

      In 5.0 i believe this doesn't happen because info.magnolia.cms.i18n.AbstractI18nContentSupport#getProperty doesn't seem to ever return null. Please double-check to make sure.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              tmattsson Tobias Mattsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD