DesignDemo: do not crash, if response to /action/... in not json / skips callback as then there is no data

This commit is contained in:
martin 2021-04-12 23:55:54 +02:00 committed by Michael Van Canneyt
parent f2e4d0834e
commit 36cb79dfb3

View File

@ -78,13 +78,12 @@ Var
aActionPayload : TJSObject;
begin
if (aCode div 100)=2 then
if ((aCode div 100)=2) and Assigned(aPayload) and Assigned(OnActionResponse) then
begin
aID:=NativeInt(aPayLoad['id']);
aName:=String(aPayLoad['name']);
aActionPayLoad:=TJSObject(aPayLoad['payload']);
If Assigned(OnActionResponse) then
OnActionResponse(Self,aID,aName,aActionPayload);
OnActionResponse(Self,aID,aName,aActionPayload);
end;
end;