This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Description
Got a crash when loading repositories in the Clone dialog. I think this is something related to the database having null or invalid data in it.
Possible repro:
- Login
- Open the clone dialog
- Crash?


The IndexKey property of the CacheIndex object being null means that in line
|
var idx = Observable.Defer(() => This.GetOrCreateObject(key, () => CacheIndex.Create(key))).Replay().RefCount(); |
the object was returned from the database instead of being newly created by the
CacheIndex.Create(key), and the database returned an empty/invalid object.
Possible fix:
After a This.GetOrCreateObject call, before the Replay (inside the Defer, basically), we should check whether the object is actually valid (has the key filled out, basically), and if it isn't we just go ahead and create one with the same create method that we pass into the GetOrCreateObject, to guarantee that even if the database is screwed up, we always have valid objects (and saving them afterwards as normal should fix any corruption in the database, so that's a nice plus).