Skip to content

Commit

Permalink
fix: add res defined check
Browse files Browse the repository at this point in the history
- closes #100 
Co-authored-by: slava.broit <slava.broit@aytm.com>
  • Loading branch information
triori authored Jul 18, 2024
1 parent 6d2b2c4 commit b09959f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ if (major < 12) {
// disable the built-in assertion
return (subject) => {
const res = innerFn(subject)
if (res.length) {
if (res && res.length) {
debug('internal get result', res)
return res
}
Expand Down Expand Up @@ -290,7 +290,7 @@ if (major < 12) {
// disable the built-in assertion
return (subject) => {
const res = innerFn(subject)
if (res.length) {
if (res && res.length) {
debug('internal contains result', res)
return res
}
Expand All @@ -314,7 +314,7 @@ if (major < 12) {
// disable the built-in assertion
return (subject) => {
const res = innerFn(subject)
if (res.length) {
if (res && res.length) {
debug('internal cy.find result', res)
return res
}
Expand Down Expand Up @@ -375,7 +375,7 @@ if (major < 12) {
// disable the built-in assertion
return (subject) => {
const res = innerFn(subject)
if (res.length) {
if (res && res.length) {
debug('internal not result', res)
return res
}
Expand Down

0 comments on commit b09959f

Please sign in to comment.