From 2567d761a48e91d23f3ed1e03d751b9fe10fcf60 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 13 Aug 2010 15:19:46 +0000 Subject: [PATCH] * Error object must be of type TJSOnErrorObject. Initialize Result to Nil in function TJSONRPCHandler.DoExecute (fixes access violation) git-svn-id: trunk@15800 - --- packages/fcl-web/src/jsonrpc/fpjsonrpc.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/fcl-web/src/jsonrpc/fpjsonrpc.pp b/packages/fcl-web/src/jsonrpc/fpjsonrpc.pp index 7414724246..923131e2b8 100644 --- a/packages/fcl-web/src/jsonrpc/fpjsonrpc.pp +++ b/packages/fcl-web/src/jsonrpc/fpjsonrpc.pp @@ -356,7 +356,7 @@ implementation function CreateJSONErrorObject(Const AMessage : String; Const ACode : Integer) : TJSONObject; begin - Result:=TJSONObject.Create(['code',ACode,'message',AMessage]) + Result:=TJSONErrorObject.Create(['code',ACode,'message',AMessage]) end; function CreateJSON2ErrorResponse(Const AMessage : String; Const ACode : Integer; ID : TJSONData = Nil; idname : TJSONStringType = 'id' ) : TJSONObject; @@ -583,6 +583,7 @@ end; function TJSONRPCHandler.DoExecute(const Params: TJSONData;AContext : TJSONRPCCallContext): TJSONData; begin + Result:=Nil; If Assigned(FOnExecute) then FOnExecute(Self,Params,Result); end;