From e626e76a66cfc698218f812ab1a94e0ec2b54eb2 Mon Sep 17 00:00:00 2001 From: Afshin Arani Date: Thu, 6 Oct 2016 14:21:21 +0330 Subject: [PATCH] Temporary Update for TLVector Deserialization Bug --- TeleSharp.TL/TLVector.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TeleSharp.TL/TLVector.cs b/TeleSharp.TL/TLVector.cs index 9c67768..4c2b539 100644 --- a/TeleSharp.TL/TLVector.cs +++ b/TeleSharp.TL/TLVector.cs @@ -43,9 +43,10 @@ namespace TeleSharp.TL else if (typeof(T).BaseType == typeof(TLObject)) { int constructor = br.ReadInt32(); - object obj = Activator.CreateInstance(typeof(T)); - typeof(T).GetMethod("DeserializeBody").Invoke(obj, new object[] { br }); - lists.Add((T)Convert.ChangeType(obj,typeof(T))); + Type type = TLContext.getType(constructor); + object obj = Activator.CreateInstance(type); + type.GetMethod("DeserializeBody").Invoke(obj, new object[] { br }); + lists.Add((T)Convert.ChangeType(obj, type)); } } }