File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
app/code/Magento/Swatches/Model/Plugin Expand file tree Collapse file tree 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)
223223 */
224224 protected function prepareOptionIds (array $ optionsArray )
225225 {
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 ]);
231233 }
232234 }
235+
233236 return $ optionsArray ;
234237 }
235238
You can’t perform that action at this time.
0 commit comments