Check that url exists before adding it

Sometimes the passed in url is nil. This avoids an exception.