Check if finalUrl is null explicitly

finalUrl could be an empty string ("") and still be valid. if we check for !finalUrl, it would return true even for the empty string and therefore it would return null, when it should return the empty string.