Fix issues found during testing

This commit is contained in:
Matt Nadareski
2023-08-15 01:38:01 -04:00
parent 3d99cf828f
commit ede4487cf0
56 changed files with 203 additions and 116 deletions

View File

@@ -14,10 +14,7 @@ namespace SabreTools.Core
public static DictionaryBase? Clone(this DictionaryBase dictionaryBase)
{
// Create a new object of the same type
var clone = dictionaryBase
.GetType()
.GetConstructor(System.Reflection.BindingFlags.Public, Array.Empty<Type>())?
.Invoke(null) as DictionaryBase;
var clone = Activator.CreateInstance(dictionaryBase.GetType()) as DictionaryBase;
// If construction failed, we can't do anything
if (clone == null)