summaryrefslogtreecommitdiff
path: root/packages/fcl-web/src
diff options
context:
space:
mode:
authormichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-08-13 15:19:46 +0000
committermichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-08-13 15:19:46 +0000
commitdceb8f4f68d8e19ebd14f5778131ad6a65760644 (patch)
tree7389635ce6f89e32d1eb1f81f950974731298728 /packages/fcl-web/src
parent37673c6306f946288b0638275f9ca29100b3d37b (diff)
downloadfpc-dceb8f4f68d8e19ebd14f5778131ad6a65760644.tar.gz
* 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
Diffstat (limited to 'packages/fcl-web/src')
-rw-r--r--packages/fcl-web/src/jsonrpc/fpjsonrpc.pp3
1 files changed, 2 insertions, 1 deletions
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;