Skip to content

Commit

Permalink
add nullcheck initParams (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiying-stripe committed Jul 2, 2024
1 parent 1da70c4 commit 31dee3f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ export const loadConnectAndInitialize: LoadConnectAndInitialize = (
initParams: IStripeConnectInitParams
): StripeConnectInstance => {
const maybeConnect = loadScript();
if (initParams == null) {
throw new Error(
"You must provide required parameters to initialize Connect"
);
}
return initStripeConnect(maybeConnect, initParams);
};

0 comments on commit 31dee3f

Please sign in to comment.