diff --git a/tgtypes.pas b/tgtypes.pas index d704511..a807832 100644 --- a/tgtypes.pas +++ b/tgtypes.pas @@ -898,10 +898,8 @@ constructor TCallbackQueryObj.Create(JSONObject: TJSONObject); destructor TCallbackQueryObj.Destroy; begin - if Assigned(FMessage) then - FMessage.Free; - if Assigned(FFrom) then - FFrom.Free; + FMessage.Free; + FFrom.Free; inherited Destroy; end; @@ -924,15 +922,13 @@ constructor TTelegramInlineQueryObj.Create(JSONObject: TJSONObject); FOffset:=fJSON.Get('offset', ''); FFrom:=TTelegramUserObj.CreateFromJSONObject(fJSON.Find('from', jtObject) as TJSONObject) as TTelegramUserObj; - FLocation:=TTelegramUserObj.CreateFromJSONObject(fJSON.Find('location', jtObject) as TJSONObject) as TTelegramLocation; + FLocation:=TTelegramLocation.CreateFromJSONObject(fJSON.Find('location', jtObject) as TJSONObject) as TTelegramLocation; end; destructor TTelegramInlineQueryObj.Destroy; begin - if Assigned(FLocation) then - FLocation.Free; - if Assigned(FFrom) then - FFrom.Free; + FLocation.Free; + FFrom.Free; inherited Destroy; end;