From 0cbf50b657739bf05af2ea3b17d956ec2cc85c04 Mon Sep 17 00:00:00 2001 From: Webkul Date: Thu, 10 Oct 2019 12:33:20 +0530 Subject: [PATCH] Generate product command bug fix --- packages/Webkul/Product/src/Type/AbstractType.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index 747d15bac..d44b20b46 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -197,7 +197,9 @@ abstract class AbstractType } } - if (request()->route()->getName() != 'admin.catalog.products.massupdate') { + $route = request()->route() ? request()->route()->getName() : ""; + + if ($route != 'admin.catalog.products.massupdate') { if (isset($data['categories'])) $product->categories()->sync($data['categories']);