File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
app/code/Magento/Swatches/Block/Adminhtml/Attribute/Edit/Options Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,16 @@ protected function reformatSwatchLabels($swatchStoreValue = null)
94
94
}
95
95
$ newSwatch = [];
96
96
foreach ($ swatchStoreValue as $ key => $ value ) {
97
- if ($ value [0 ] == '# ' ) {
98
- $ newSwatch [$ key ] = 'background: ' .$ value ;
99
- } elseif ($ value [0 ] == '/ ' ) {
100
- $ mediaUrl = $ this ->swatchHelper ->getSwatchMediaUrl ();
101
- $ newSwatch [$ key ] = 'background: url( ' .$ mediaUrl .$ value .'); background-size: cover; ' ;
97
+ if (is_string ($ value ) && !empty ($ value )) {
98
+ if ($ value [0 ] == '# ' ) {
99
+ $ newSwatch [$ key ] = 'background: ' . $ value ;
100
+ } elseif ($ value [0 ] == '/ ' ) {
101
+ $ mediaUrl = $ this ->swatchHelper ->getSwatchMediaUrl ();
102
+ $ newSwatch [$ key ] = 'background: url( ' . $ mediaUrl . $ value . '); background-size: cover; ' ;
103
+ }
102
104
}
103
105
}
106
+
104
107
return $ newSwatch ;
105
108
}
106
109
}
You can’t perform that action at this time.
0 commit comments