Added a check to make sure this value is not added twice to the dictionary.

This commit is contained in:
OG 2020-12-07 01:48:14 +02:00
parent 1b06473108
commit becb9172d0

View file

@ -20,8 +20,11 @@ namespace TeleSharp.TL
where t.IsSubclassOf(typeof(TLObject)) where t.IsSubclassOf(typeof(TLObject))
where t.GetCustomAttribute(typeof(TLObjectAttribute)) != null where t.GetCustomAttribute(typeof(TLObjectAttribute)) != null
select t).ToDictionary(x => ((TLObjectAttribute)x.GetCustomAttribute(typeof(TLObjectAttribute))).Constructor, x => x); select t).ToDictionary(x => ((TLObjectAttribute)x.GetCustomAttribute(typeof(TLObjectAttribute))).Constructor, x => x);
if (!Types.TryGetValue(481674261, out _))
{
Types.Add(481674261, typeof(TLVector<>)); Types.Add(481674261, typeof(TLVector<>));
} }
}
public static Type getType(int Constructor) public static Type getType(int Constructor)
{ {