mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Added IList cast and null check
This commit is contained in:
1 parent
e5658df8c5
commit
80b8af85cb
1 file changed
+11
-1
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
@@ -151,7 +152,16 @@ public static class ModdedOptionsManager
|
||||
return;
|
||||
}
|
||||
|
||||
var optionList = attribute.CreateOptionList(property.GetValue(group), property);
|
||||
var propertyVal = property.GetValue(group);
|
||||
|
||||
if (propertyVal == null)
|
||||
{
|
||||
Error("Cannot initialize option list with null value.");
|
||||
return;
|
||||
}
|
||||
|
||||
var propertyList = (IList)propertyVal;
|
||||
var optionList = attribute.CreateOptionList(propertyList, property);
|
||||
|
||||
if (optionList == null)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user