From 1ccb1f6e1d188163d4547552d68e1d4ad6eba289 Mon Sep 17 00:00:00 2001 From: Joel Thiessen <444632+joelclimbsthings@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:48:14 -0800 Subject: [PATCH] Fixing references to null value throwing errors on products task (https://github.com/woocommerce/woocommerce-admin/pull/7934) --- .../client/tasks/fills/products/product-template-modal.js | 2 +- .../woocommerce-admin/client/tasks/fills/products/products.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/product-template-modal.js b/plugins/woocommerce-admin/client/tasks/fills/products/product-template-modal.js index 29b08e08ef4..f372fe73d20 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/products/product-template-modal.js +++ b/plugins/woocommerce-admin/client/tasks/fills/products/product-template-modal.js @@ -124,7 +124,7 @@ export default function ProductTemplateModal( { onClose } ) { const removeSubscriptions = ( window.wcAdminFeatures && ! window.wcAdminFeatures.subscriptions ) || countryCode !== 'US' || - ! profileItems.product_types.includes( 'subscriptions' ) || + ! profileItems.product_types?.includes( 'subscriptions' ) || ! installedPlugins.includes( 'woocommerce-payments' ); const productTemplates = removeSubscriptions diff --git a/plugins/woocommerce-admin/client/tasks/fills/products/products.js b/plugins/woocommerce-admin/client/tasks/fills/products/products.js index 157471ada19..a0f5579d076 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/products/products.js +++ b/plugins/woocommerce-admin/client/tasks/fills/products/products.js @@ -123,7 +123,7 @@ const Products = () => { window.wcAdminFeatures && window.wcAdminFeatures.subscriptions && countryCode === 'US' && - profileItems.product_types.includes( 'subscriptions' ) && + profileItems.product_types?.includes( 'subscriptions' ) && installedPlugins.includes( 'woocommerce-payments' ) ) { const task = subTasks.find(