BaseEntity.assignAttribute assumes all non-simple values are structs

Description

We had some code that worked in previous versions of Quick that started failing with this error on line 237 of BaseEntity.cfc:

1 Can't cast Object type [Binary] to a value of type [Struct] Java type of the object is byte[]

The attribute in question is a binary field (cf_sql_varbinary). The relevant code is assuming that a non-simple value must be a struct:

1 2 if ( ! isSimpleValue( arguments.value ) ) { if ( ! structKeyExists( arguments.value, "keyValue" ) ) {

I know everybody hates type checking but I put in a workaround that replaces that first line with:

1 if ( ! isSimpleValue( arguments.value ) && !isBinary( arguments.value ) ) {

Might be faster or preferable to do isStruct or some other alternative - only had a moment to get into it.

Environment

None

Status

Assignee

Unassigned

Reporter

Samuel W. Knowlton

Labels

None

Priority

Major
Configure