diff --git a/src/index.js b/src/index.js index dd69a67..4ec6243 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,7 @@ const debug = require('debug')('cypress-if') -const isIfCommand = (cmd) => cmd?.attributes?.name === 'if' +const isIfCommand = (cmd) => + cmd && cmd.attributes && cmd.attributes.name === 'if' function skipRestOfTheChain(cmd, chainerId) { while (