Missing Database Reference Hotfix

Database inspector was crashing when selecting a blueprint with missing ingredients
This commit is contained in:
hyperion51 2020-04-29 23:36:00 +01:00
commit 8d1b7bed28
10 changed files with 115 additions and 29 deletions

View file

@ -642,6 +642,12 @@ public class DatabaseInspector : EditorWindow
using (var h = new HorizontalScope(_list.ListItemStyle))
{
var entry = DatabaseCache.Get(ingredient.Key);
if (entry == null)
{
value.Remove(ingredient.Key);
GUI.changed = true;
return;
}
if(entry is INamedEntry named)
GUILayout.Label(named.EntryName);
else GUILayout.Label(entry.ID.ToString());