File tree 1 file changed +8
-5
lines changed
app/code/Magento/Swatches/Model/Plugin 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -223,13 +223,16 @@ protected function processSwatchOptions(Attribute $attribute)
223
223
*/
224
224
protected function prepareOptionIds (array $ optionsArray )
225
225
{
226
- if (isset ($ optionsArray ['value ' ]) && is_array ($ optionsArray ['value ' ])) {
227
- foreach (array_keys ($ optionsArray ['value ' ]) as $ optionId ) {
228
- if (isset ($ optionsArray ['delete ' ][$ optionId ]) && $ optionsArray ['delete ' ][$ optionId ] == 1 ) {
229
- unset($ optionsArray ['value ' ][$ optionId ]);
230
- }
226
+ if (!is_array ($ optionsArray ['value ' ] ?? null )) {
227
+ return $ optionsArray ;
228
+ }
229
+
230
+ foreach (array_keys ($ optionsArray ['value ' ]) as $ optionId ) {
231
+ if (isset ($ optionsArray ['delete ' ][$ optionId ]) && (int )$ optionsArray ['delete ' ][$ optionId ] === 1 ) {
232
+ unset($ optionsArray ['value ' ][$ optionId ]);
231
233
}
232
234
}
235
+
233
236
return $ optionsArray ;
234
237
}
235
238
You can’t perform that action at this time.
0 commit comments