Include null check on url before trimming.