Fixes #5064

Check for $params['url'] to be set before assigning