We are getting an undefined error exception when assigning a .first() query that return no results. The issue is related to the return logic in the first() query function in the QuickBuilder.cfc (line: 740). It returns a javaCast null if the query result is empty. According to the Adobe CF documentations, unexpected results will occur if you assign a javacast null to a variable. Our suggestion is to return the empty attribute to avoid this unexpected behavior. That is logic used in the qb orm library that Quick is based on.
This is highly unlikely to change. It is clearly documented in the docs.. It has been this way for many major versions of Quick. To change now would not only be a breaking change but a major one for all users of Quick.
You can easily check for a result using isNull( entity ) or use one of the *orFail helper methods like firstOrFail and catch the exception. This has the added benefit of being able to provide a consistent response for all EntityNotFound exceptions.
Sorry for the late response. IsNull() does work if validated before assigning to a variable. My workaround was to validate before returning the result to another variable and avoid the exception. Thanks again!