Skip to content

Commit

Permalink
fix(context): merge request option issue (#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd authored Mar 19, 2023
2 parents 5a6106d + e24e695 commit 97cbf2f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/context/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ finiteStateMachineProvider.defineActions<ServerContextFsm>(serverContextFsmConst

try {
const {response, options} = fsm.getContext();
if (options == null) return logger.error('action_request', 'invalid_fetch_options', {id: fsm.id});
if (options == null || options.url == null) {
return logger.error('action_request', 'invalid_fetch_options', {id: fsm.id, options});
}
const newResponse = await serviceRequest<NonNullable<ServerContextFsmContext['response']>>(
options as StringifyableFetchOptions,
);
Expand Down Expand Up @@ -170,6 +172,7 @@ export const setOptions = (
// prettier-ignore
fsm.setContext({
options: merge === false ? options : {
...oldOptions,
...options,
queryParameters: {
...oldOptions?.queryParameters,
Expand Down

0 comments on commit 97cbf2f

Please sign in to comment.