Closed ggrossetie closed 6 years ago
Hi,
Yes, I agree null-checks are kind of a pain. We need to find the right way to do it, I'm not sure yet what it is.
OK let me know if I can help.
Guillaume Le 8 déc. 2014 23:33, "Erwan Loisant" notifications@github.com a écrit :
Hi,
Yes, I agree null-checks are kind of a pain. We need to find the right way to do it, I'm not sure yet what it is.
— Reply to this email directly or view it on GitHub https://github.com/prismicio/javascript-kit/issues/78#issuecomment-66200888 .
@erwan - any thoughts on this?
Hi @mattfysh ,
I'm no longer involved in this project, but @arnaudlewis will probably follow up from here ;)
This issue is resolved by using the prismic.io API v2 with the prismic-javascript and prismic-dom kits. We recommend updating to this setup to avoid this issue.
Hi,
I have some optional attributes in my document. I'm using Node.js/Express with
ejs
template:The problem is that I need to check that
document.get("page.catch_phrase") != null
before callingasText()
. Something like:This is really verbose and I need to be extra careful because if I forget one of them my template will return a HTTP 500 :cry: Can we add a shortcut method to handle optional attribute ?
Thanks