diff --git a/src/payment/data/reducers.js b/src/payment/data/reducers.js index e83618d20..847233eec 100644 --- a/src/payment/data/reducers.js +++ b/src/payment/data/reducers.js @@ -36,7 +36,9 @@ const basket = (state = basketInitialState, action = null) => { }; case BASKET_DATA_RECEIVED: - localStorage.setItem('sku', action.payload.products[0].sku); + if (action.payload.products && action.payload.products.length > 0) { + localStorage.setItem('sku', action.payload.products[0].sku); + } return { ...state, ...action.payload }; case BASKET_PROCESSING: return {