Skip to content

Commit 595b152

Browse files
authored
Merge pull request #2671 from checkitonus/bug/invalid-template-23
Quick check to make sure the template exists
2 parents cc15d07 + 6dedaca commit 595b152

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Bus/Handlers/Commands/Incident/ReportIncidentCommandHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function handle(ReportIncidentCommand $command)
7070
'visible' => $command->visible,
7171
];
7272

73-
if ($command->template) {
73+
if (IncidentTemplate::where('slug', '=', $command->template)->first()) {
7474
$data['message'] = $this->parseIncidentTemplate($command->template, $command->template_vars);
7575
} else {
7676
$data['message'] = $command->message;

0 commit comments

Comments
 (0)