Skip to content

Don't crash when an operation returns a null value#98

Merged
jnicklas merged 1 commit intomasterfrom
null-operations
Apr 23, 2020
Merged

Don't crash when an operation returns a null value#98
jnicklas merged 1 commit intomasterfrom
null-operations

Conversation

@cowboyd
Copy link
Copy Markdown
Member

@cowboyd cowboyd commented Apr 22, 2020

We need to check for resources on return values of operations in order to link them to the parent context. To do this, we check that the object can receive property access. However, typeof null is actually "object".

This adjusts the check to cover both undefined and null (as well as any other object type)

We need to check for resources on return values of operations in order
to link them to the parent context. To do this, we check that the
object can receive property access. However, `typeof null` is actually
`"object"`.

This adjusts the check to cover both undefined and null (as well as
any other object type)
@cowboyd cowboyd requested a review from jnicklas April 22, 2020 20:30
@github-actions
Copy link
Copy Markdown
Contributor

A preview package of this pull request has been published with the tag null-operations.
You can try it out by running the following command:

$ npm install effection@null-operations

or by updating your package.json to:

{
  "effection": "null-operations"
}

Generated by 🚫 dangerJS against bf1ff79

@jnicklas jnicklas merged commit 53c12ce into master Apr 23, 2020
@jnicklas jnicklas deleted the null-operations branch April 23, 2020 14:44
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.

2 participants