diff --git a/spyder/plugins/ipythonconsole/widgets/shell.py b/spyder/plugins/ipythonconsole/widgets/shell.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/ipythonconsole/widgets/shell.py
+++ b/spyder/plugins/ipythonconsole/widgets/shell.py
@@ -173,6 +173,9 @@ class ShellWidget(NamepaceBrowserWidget, HelpWidget, DebuggingWidget,
             return
         self.shutting_down = True
         if shutdown_kernel:
+            if not self.kernel_manager:
+                return
+
             self.interrupt_kernel()
             self.spyder_kernel_comm.close()
             self.kernel_manager.stop_restarter()
IPython console: Catch error when shutting down kernels and no kernel manager is available