We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
These lines fail https://github.com/canjs/can-stache-key/blob/master/can-stache-key.js#L190-L192
when a promise getter returns null, because typeof null is 'object' and null.then causes an error.
null.then
Example, I might not want to return a promise when there is no id to view, so I return null:
focusObjectPromise: { get () { if (this.viewId) { const params = {}; params[this.view.connection.idProp] = this.viewId; const promise = this.view.connection.get(params); promise.catch((err) => { dev.warn('unable to complete focusObject request', err); }); return promise; } return null; } },
The text was updated successfully, but these errors were encountered:
Merge pull request #3 from canjs/fix-promise-getter-return-null-#2
2785b30
it returns null when promise getter returns null
cherifGsoul
Successfully merging a pull request may close this issue.
These lines fail https://github.com/canjs/can-stache-key/blob/master/can-stache-key.js#L190-L192
when a promise getter returns null, because typeof null is 'object' and
null.then
causes an error.Example, I might not want to return a promise when there is no id to view, so I return null:
The text was updated successfully, but these errors were encountered: