Check for null or empty referrer before redirecting after a logout