Fix an error when editing an unreachable repo (#503454).
In certain cases, calling getRepo on "InstallationRepo" causes a RepoError.
When we catch that, we don't set the repo value to anything, so a traceback
results. Instead we need to fix the fix for creating a new repo.