2
0
Эх сурвалжийг харах

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

martin 4 жил өмнө
parent
commit
36cb79dfb3

+ 2 - 3
demo/webwidget/designdemo/webideclient.pp

@@ -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;