Skip to content

Commit

Permalink
Merge pull request netlify#637 from XhmikosR/patch-2
Browse files Browse the repository at this point in the history
Remove useless conditional
  • Loading branch information
DavidWells authored Dec 10, 2019
2 parents 54bf4f0 + 72c450a commit a343685
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/commands/functions/invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,12 @@ function processPayloadFromFlag(payloadString) {
// case 2: jsonpath
const payloadpath = path.join(process.cwd(), payloadString)
const pathexists = fs.existsSync(payloadpath)
if (!payload && pathexists) {
if (pathexists) {
try {
payload = require(payloadpath) // there is code execution potential here
return payload
} catch (err) {
console.error(err)
payload = false
}
}
// case 3: invalid string, invalid path
Expand Down

0 comments on commit a343685

Please sign in to comment.