From dceb8f4f68d8e19ebd14f5778131ad6a65760644 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 13 Aug 2010 15:19:46 +0000 Subject: * Error object must be of type TJSOnErrorObject. Initialize Result to Nil in function TJSONRPCHandler.DoExecute (fixes access violation) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15800 3ad0048d-3df7-0310-abae-a5850022a9f2 --- packages/fcl-web/src/jsonrpc/fpjsonrpc.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/fcl-web/src') 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; -- cgit v1.2.1