diff --git a/src/Commands/PreCommitHookCommand.php b/src/Commands/PreCommitHookCommand.php index a3f0553..d20ef7d 100644 --- a/src/Commands/PreCommitHookCommand.php +++ b/src/Commands/PreCommitHookCommand.php @@ -43,17 +43,19 @@ public function handle(): int $process->run(); - $result = json_decode($process->getOutput(), true); - - render( - view('git-commit-checker::summary', [ - 'result' => $result, - 'isSuccessful' => $process->isSuccessful(), - ]) - ); - - if (! $process->isSuccessful()) { - return self::FAILURE; + if ($process->getOutput()) { + $result = json_decode($process->getOutput(), true); + + render( + view('git-commit-checker::summary', [ + 'result' => $result, + 'isSuccessful' => $process->isSuccessful(), + ]) + ); + + if (! $process->isSuccessful()) { + return self::FAILURE; + } } return self::SUCCESS;