PBR-557 NPE in PortletResource
  Reverted some changes advised by Sonar, as they impacted the code behavior