Skip to content

Commit

Permalink
fix: default empty array for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
estephinson committed Nov 17, 2023
1 parent 98f531a commit 14b8f32
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/commands/logs/functions.mts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ const logsFunction = async (functionName: string | undefined, options: OptionVal
const { site } = command.netlify
const { id: siteId } = site

const { functions } = await client.searchSiteFunctions({ siteId })
const { functions = [] } = await client.searchSiteFunctions({ siteId })

if (functions.length === 0) {
log(`No functions found for the site`)
return
}

let selectedFunction
if (functionName) {
Expand Down

0 comments on commit 14b8f32

Please sign in to comment.