From becb9172d0410fac446dde5dee759737e8efe1f2 Mon Sep 17 00:00:00 2001 From: OG Date: Mon, 7 Dec 2020 01:48:14 +0200 Subject: [PATCH] Added a check to make sure this value is not added twice to the dictionary. --- TeleSharp.TL/TLContext.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TeleSharp.TL/TLContext.cs b/TeleSharp.TL/TLContext.cs index be439361..6cd090f7 100644 --- a/TeleSharp.TL/TLContext.cs +++ b/TeleSharp.TL/TLContext.cs @@ -20,7 +20,10 @@ static TLContext() where t.IsSubclassOf(typeof(TLObject)) where t.GetCustomAttribute(typeof(TLObjectAttribute)) != null select t).ToDictionary(x => ((TLObjectAttribute)x.GetCustomAttribute(typeof(TLObjectAttribute))).Constructor, x => x); - Types.Add(481674261, typeof(TLVector<>)); + if (!Types.TryGetValue(481674261, out _)) + { + Types.Add(481674261, typeof(TLVector<>)); + } } public static Type getType(int Constructor)