mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-26 22:43:52 +02:00
* Error object must be of type TJSOnErrorObject. Initialize Result to Nil in function TJSONRPCHandler.DoExecute (fixes access violation)
git-svn-id: trunk@15800 -
This commit is contained in:
parent
6403d462d2
commit
2567d761a4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user