Uploaded image for project: 'Hippo Site Toolkit 2'
  1. Hippo Site Toolkit 2
  2. HSTTWO-3398

HstLinkImpl avoid possible NPE's in case mount instance variable is null

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.0
    • Component/s: None
    • Labels:
    • Similar issues:

      Description

      in general, it should never happen, however the HstLink api says:

         /**
           * @return the {@link Mount} that can represent this link. This might be an  {@link Mount} which is a different one then the
           *  {@link Mount} the link was created in. This could result in a cross-domain (different hostname) link being created, depending
           * on the backing {@link Mount#getVirtualHost()}. If no {@link Mount} is set, <code>null</code> can be returned
           * 
           */
          Mount getMount();
      

      Most of the HstLinkImpl logic has null checks whenever 'mount' instance var is used, however the org.hippoecm.hst.core.linking.HstLinkImpl.HstLinkImplCharacteristics does not have these null checks. We should include them, and in case the mount is null, return some sensible default

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              aschrijvers Ard Schrijvers
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: