Skip to content

Commit 394d9ba

Browse files
committed
defensive coding fix
1 parent 98f6734 commit 394d9ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/ortus/boxlang/modules/orm/bifs/EntityLoad.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public Object _invoke( IBoxContext context, ArgumentsScope arguments ) {
7979
// If the uniqueOrOrder is a struct, we need to move it to options
8080
arguments.put( ORMKeys.options, arguments.get( ORMKeys.uniqueOrOrder ) );
8181
arguments.remove( ORMKeys.uniqueOrOrder );
82-
} else {
83-
arguments.put( ORMKeys.options, StringCaster.cast( arguments.get( ORMKeys.options ) ) );
82+
} else if ( arguments.get( ORMKeys.uniqueOrOrder ) != null ) {
83+
arguments.put( ORMKeys.uniqueOrOrder, StringCaster.cast( arguments.get( ORMKeys.uniqueOrOrder ) ) );
8484
}
8585
if ( arguments.containsKey( ORMKeys.idOrFilter ) ) {
8686
boolean idIsSimpleValue = StringCaster.attempt( arguments.get( ORMKeys.idOrFilter ) ).wasSuccessful();

0 commit comments

Comments
 (0)