Skip to content

fix(test-utils): verify object not null for typeof - #1897

Merged
lmiller1990 merged 1 commit into
vuejs:devfrom
ataias:fix/issue-1805/verify-null-before-calling-property
Oct 29, 2021
Merged

fix(test-utils): verify object not null for typeof#1897
lmiller1990 merged 1 commit into
vuejs:devfrom
ataias:fix/issue-1805/verify-null-before-calling-property

Conversation

@ataias

@ataias ataias commented Aug 19, 2021

Copy link
Copy Markdown
Contributor

Using vue-test-utils may cause several messages of the sort

[Vue warn]: Error in render: "TypeError: Cannot read property 'template' of null"

Such messages stemmed from the isComponentOptions method call. It
seems it received a null object and typeof null is object, so this
error propagates to users of the library.

This patch does not look for the reason a null object was sent in the
first place, but it avoids the error propagation.

close #1805

Using vue-test-utils may cause several messages of the sort
```
[Vue warn]: Error in render: "TypeError: Cannot read property 'template' of null"
```

Such messages stemmed from the `isComponentOptions` method call. It
seems it received a null object and `typeof null` is object, so this
error propagates to users of the library.

This patch does not look for the reason a null object was sent in the
first place, but it avoids the error propagation.

close #1805
@lmiller1990
lmiller1990 merged commit dace7f1 into vuejs:dev Oct 29, 2021
@ataias
ataias deleted the fix/issue-1805/verify-null-before-calling-property branch October 29, 2021 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Vue warn]: Error in render: "TypeError: Cannot read property 'template' of null"

2 participants