Skip to content

Commit

Permalink
fix: 🐛 validate only if truthy
Browse files Browse the repository at this point in the history
  • Loading branch information
heldrida committed Nov 1, 2024
1 parent 02c3890 commit 992386e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/functions/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const createAction: SdkGuardedFunction<CreateFunctionArgs> = async ({
}) => {
const { name, siteId } = args;
const functionName = await getFunctionNameOrPrompt({ name });

if (!siteId || !(await isSiteIdValid({ siteId, sdk }))) {
if (siteId && !(await isSiteIdValid({ siteId: siteId as string, sdk }))) {
output.error(t('siteNotFound'));
return;
}
Expand Down

0 comments on commit 992386e

Please sign in to comment.