Skip to content

Commit 9c1b8f7

Browse files
committed
COLDBOX-715 #resolve
Elvis operator in AbstractFlashScope throws ACF Error
1 parent 3692b01 commit 9c1b8f7

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

system/modules/HTMLHelper/models/HTMLHelper.cfc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,7 +2348,7 @@ component extends="coldbox.system.FrameworkSupertype" accessors=true singleton{
23482348
var key = "";
23492349

23502350
// Metadata
2351-
var firstMetadata = getMetadata( arguments.data[ 1 ] ?: {} );
2351+
var firstMetadata = getMetadata( arguments.data[ 1 ] ?: structNew() );
23522352
// All properties
23532353
var properties = structKeyExists( firstMetadata, "properties" ) ? firstMetadata.properties : [];
23542354
// Filtered properties
@@ -2398,7 +2398,7 @@ component extends="coldbox.system.FrameworkSupertype" accessors=true singleton{
23982398
required buffer
23992399
){
24002400
// Guess columns from first struct found
2401-
var columns = structKeyArray( data[ 1 ] ?: {} )
2401+
var columns = structKeyArray( data[ 1 ] ?: structNew() )
24022402
.filter( function( item ){
24032403
return ( passIncludeExclude( item, includes, excludes ) );
24042404
} );

system/web/flash/AbstractFlashScope.cfc

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,20 @@ component accessors="true"{
4141
variables.defaults = arguments.defaults;
4242

4343
// Defaults checks, just in case
44-
if( ! structKeyExists( variables.defaults,"inflateToRC") ){ variables.defaults.inflateToRC = true; }
45-
if( ! structKeyExists( variables.defaults,"inflateToPRC") ){ variables.defaults.inflateToPRC = false; }
46-
if( ! structKeyExists( variables.defaults,"autoPurge") ){ variables.defaults.autoPurge = true; }
44+
if( ! structKeyExists( variables.defaults, "inflateToRC" ) ){
45+
variables.defaults.inflateToRC = true;
46+
}
47+
if( ! structKeyExists( variables.defaults, "inflateToPRC" ) ){
48+
variables.defaults.inflateToPRC = false;
49+
}
50+
if( ! structKeyExists( variables.defaults, "autoPurge" ) ){
51+
variables.defaults.autoPurge = true;
52+
}
4753

4854
// check for properties
4955
if( structKeyExists( arguments.defaults, "properties" ) ){
5056
variables.properties = arguments.defaults.properties;
51-
}
52-
else{
57+
} else {
5358
variables.properties = {};
5459
}
5560

@@ -90,10 +95,13 @@ component accessors="true"{
9095
// Check if flash exists
9196
if( flashExists() ){
9297
var scope = getFlash();
93-
98+
9499
scope
95100
.filter( function( key, value ){
96-
return ( value.autoPurge ?: false );
101+
if( value.keyExists( "autoPurge" ) ){
102+
return value.autoPurge;
103+
}
104+
return false;
97105
} )
98106
.keyArray()
99107
.each( function( item ){

0 commit comments

Comments
 (0)