Check the return value of repo_get_remote_collection_id like we do in other places. This doesn't really affect the result, because we return NULL both before and after in the failure case, but it makes things clearer.