Fixed improperly initialized mods crashing the database
This commit is contained in:
@@ -84,11 +84,15 @@ public class DatabaseDialog extends BaseDialog{
|
|||||||
for(var contents : allContent){
|
for(var contents : allContent){
|
||||||
for(var content : contents){
|
for(var content : contents){
|
||||||
if(content instanceof UnlockableContent u){
|
if(content instanceof UnlockableContent u){
|
||||||
var categoryContents = sortedContents.get(u.databaseCategory == null ? u.getContentType().name() : u.databaseCategory, new OrderedMap<>());
|
//some mods don't initialize these properly
|
||||||
var taggedContents = categoryContents.get(u.databaseTag == null ? "default" : u.databaseTag, new Seq<>());
|
String cat = u.databaseCategory == null ? u.getContentType().name() : u.databaseCategory;
|
||||||
|
String tag = u.databaseTag == null ? "default" : u.databaseTag;
|
||||||
|
|
||||||
|
var categoryContents = sortedContents.get(cat, new OrderedMap<>());
|
||||||
|
var taggedContents = categoryContents.get(tag, new Seq<>());
|
||||||
taggedContents.add(u);
|
taggedContents.add(u);
|
||||||
categoryContents.put(u.databaseTag, taggedContents);
|
categoryContents.put(tag, taggedContents);
|
||||||
sortedContents.put(u.databaseCategory, categoryContents);
|
sortedContents.put(cat, categoryContents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user