mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-07 18:07:49 +02:00
DesignDemo: do not crash, if response to /action/... in not json / skips callback as then there is no data
This commit is contained in:
parent
f2e4d0834e
commit
36cb79dfb3
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user