diff --git a/src/Cli/Command/NavigateCommand.php b/src/Cli/Command/NavigateCommand.php index d0f6581058b..0b392ccf34d 100644 --- a/src/Cli/Command/NavigateCommand.php +++ b/src/Cli/Command/NavigateCommand.php @@ -27,7 +27,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int // Handle request and output resonse body $response = $app->handle($request); - $output->writeln($response->getBody(), OutputInterface::OUTPUT_RAW); + $output->writeln($response->getBody() ?? '', OutputInterface::OUTPUT_RAW); // Transform HTTP status code into sensible exit code $responseCode = $response->getStatusCode(); diff --git a/tests/php/Cli/Command/NavigateCommandTest.php b/tests/php/Cli/Command/NavigateCommandTest.php index 4eeec534d51..2e7b2b82349 100644 --- a/tests/php/Cli/Command/NavigateCommandTest.php +++ b/tests/php/Cli/Command/NavigateCommandTest.php @@ -13,7 +13,7 @@ class NavigateCommandTest extends SapphireTest { - protected $usesDatabase = false; + protected $usesDatabase = true; public static function provideExecute(): array {