Michael Dawson
03/11/2022, 10:55 PM<cfif !isNull(article.photoUrl)>...</cfif>
No matter what, that cfif statement always returns true.
If I change it to:
<cfif article.photoUrl != null>...</cfif>
Lo and behold, it works as expected.
Maybe I misunderstand the meaning of the isNull() function.Adam Cameron
article
is a query here, yeah? and photoUrl
is a column?
I suspect isNull(article.photoUrl)
is checking the column, not the value within the currentRow
of the column.
And I suspect this is because the way code using isNull
is compiled needs to do some cheating so that it doesn't just get a article.photoUrl is undefined
on the function call, before isNull
even has a chance to run. And the internal workings of isNull
don't respect that article.photoUrl
can be shorthand for article.photoUrl[article.currentRow]
.
This is, however, a guess.Michael Dawson
03/13/2022, 10:15 PM