File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,18 +160,21 @@ procedure Middleware(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);
160160 after the process that de-serialize this info
161161 *)
162162 LRouteMatch := ExtractParamFromHorseRoute(Req.PathInfo);
163- try
164- if (LRouteMatch.Params.Count > 0 ) then
165- begin
166- for LKeySource in LRouteMatch.Params.Keys do
163+ if Assigned(LRouteMatch.Params) then
164+ begin
165+ try
166+ if ( LRouteMatch.Params.Count > 0 ) then
167167 begin
168- if LKeySource.Trim.IsEmpty then
169- Continue;
170- Req.Params.Dictionary.AddOrSetValue(LKeySource, LRouteMatch.Params.Items[LKeySource]);
168+ for LKeySource in LRouteMatch.Params.Keys do
169+ begin
170+ if LKeySource.Trim.IsEmpty then
171+ Continue;
172+ Req.Params.Dictionary.AddOrSetValue(LKeySource, LRouteMatch.Params.Items[LKeySource]);
173+ end ;
171174 end ;
175+ finally
176+ LRouteMatch.Params.Free;
172177 end ;
173- finally
174- LRouteMatch.Params.Free;
175178 end ;
176179{ $ENDIF}
177180 ManipulateRequestCallBack(Req);
You can’t perform that action at this time.
0 commit comments