Temporary Update for TLVector Deserialization Bug

This commit is contained in:
Afshin Arani 2016-10-06 14:21:21 +03:30 committed by GitHub
parent cd48986200
commit e626e76a66

View file

@ -43,9 +43,10 @@ namespace TeleSharp.TL
else if (typeof(T).BaseType == typeof(TLObject)) else if (typeof(T).BaseType == typeof(TLObject))
{ {
int constructor = br.ReadInt32(); int constructor = br.ReadInt32();
object obj = Activator.CreateInstance(typeof(T)); Type type = TLContext.getType(constructor);
typeof(T).GetMethod("DeserializeBody").Invoke(obj, new object[] { br }); object obj = Activator.CreateInstance(type);
lists.Add((T)Convert.ChangeType(obj,typeof(T))); type.GetMethod("DeserializeBody").Invoke(obj, new object[] { br });
lists.Add((T)Convert.ChangeType(obj, type));
} }
} }
} }