Tests: Fix crash on non-string plugin options parsing
This commit is contained in:
@@ -93,8 +93,7 @@ namespace Il2CppInspector
|
|||||||
Console.WriteLine($"Setting option: {key} = {value}");
|
Console.WriteLine($"Setting option: {key} = {value}");
|
||||||
|
|
||||||
// Null default values must be castable to object
|
// Null default values must be castable to object
|
||||||
var targetType = ourPlugin[key]?.GetType() ?? typeof(object);
|
ourPlugin.Plugin.Options.Single(o => o.Name == key).SetFromString(value);
|
||||||
ourPlugin[key] = Convert.ChangeType(value, targetType);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user