From 4a0ec1ddb34ed9b642827b9193cefbc5d94d07ef Mon Sep 17 00:00:00 2001 From: ShockedPlot7560 Date: Tue, 9 Jul 2024 09:20:31 +0000 Subject: [PATCH] fix crash not repported when last error is null --- src/TestProcessor.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/TestProcessor.php b/src/TestProcessor.php index 16a3cbf..eb31a9a 100644 --- a/src/TestProcessor.php +++ b/src/TestProcessor.php @@ -73,7 +73,11 @@ public function stop() : void { if (TestMemory::$currentTest !== null) { global $lastExceptionError, $lastError; $error = $lastExceptionError ?? $lastError; - TestResults::fatalTest(TestMemory::$currentTest, ServerCrashedException::fromArray($error)); + if($error === null){ + TestResults::fatalTest(TestMemory::$currentTest, new ServerCrashedException()); + }else{ + TestResults::fatalTest(TestMemory::$currentTest, ServerCrashedException::fromArray($error)); + } $this->finish(false); } }