diff --git a/src/PrestaShopBundle/Controller/Admin/ModuleController.php b/src/PrestaShopBundle/Controller/Admin/ModuleController.php index 95b5b25a360b7..27a98e47cb412 100755 --- a/src/PrestaShopBundle/Controller/Admin/ModuleController.php +++ b/src/PrestaShopBundle/Controller/Admin/ModuleController.php @@ -231,8 +231,10 @@ public function importModuleAction(Request $request) array( 'Content-Type' => 'application/json' ) ); } catch (Exception $e) { - $modulesProvider = $this->container->get('prestashop.core.admin.data_provider.module_interface'); - $modulesProvider->removeModuleFromDisk($module_name); + if (isset($module_name)) { + $modulesProvider = $this->container->get('prestashop.core.admin.data_provider.module_interface'); + $modulesProvider->removeModuleFromDisk($module_name); + } return new JsonResponse(array( 'status' => false, 'msg' => $e->getMessage()),