diff --git a/src/Leevel/Kernel/App.php b/src/Leevel/Kernel/App.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Kernel/App.php
+++ b/src/Leevel/Kernel/App.php
@@ -164,7 +164,10 @@ class App implements IApp
             return \PHP_SAPI === 'cli';
         }
 
-        return $this->container->make('request')->isConsole();
+        /** @var \Leevel\Http\Request $request */
+        $request = $this->container->make('request');
+
+        return $request->isConsole();
     }
 
     /**
diff --git a/src/Leevel/Kernel/ExceptionRuntime.php b/src/Leevel/Kernel/ExceptionRuntime.php
index <HASH>..<HASH> 100644
--- a/src/Leevel/Kernel/ExceptionRuntime.php
+++ b/src/Leevel/Kernel/ExceptionRuntime.php
@@ -328,7 +328,7 @@ abstract class ExceptionRuntime implements IExceptionRuntime
         extract($vars);
         ob_start();
         require $filepath;
-        $content = ob_get_contents();
+        $content = ob_get_contents() ?: '';
         ob_end_clean();
 
         return $content;
fix(kernel): fix for phpstan level 7