diff --git a/Confuser.Core/ObfAttrParser.cs b/Confuser.Core/ObfAttrParser.cs index 702cba695..5d7dbe61c 100644 --- a/Confuser.Core/ObfAttrParser.cs +++ b/Confuser.Core/ObfAttrParser.cs @@ -202,6 +202,9 @@ public void ParseProtectionString(ProtectionSettings settings, string str) { case ParseState.EndItem: if (settings != null) { + if (!items.Contains(protId)) + throw new KeyNotFoundException("Cannot find protection with id '" + protId + "'."); + if (protAct) { settings[(Protection)items[protId]] = protParams; } @@ -243,7 +246,11 @@ public void ParsePackerString(string str, out Packer packer, out Dictionary