Add more control flow conditions to check the wiki page context before setting the portalSpaceLabel to currentSpaceName
Check if portalSpaceLabel is empty