Check for SB being avail before filing #668 (#669)

This commit is contained in:
Nabeel S 2020-04-26 10:23:42 -04:00 committed by GitHub
parent b21201c122
commit 866d95c945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -350,10 +350,11 @@ class PirepController extends Controller
if ($request->has('sb_id')) { if ($request->has('sb_id')) {
$brief = SimBrief::find($request->input('sb_id')); $brief = SimBrief::find($request->input('sb_id'));
if ($brief !== null) {
/** @var SimBriefService $sbSvc */ /** @var SimBriefService $sbSvc */
$sbSvc = app(SimBriefService::class); $sbSvc = app(SimBriefService::class);
$sbSvc->attachSimbriefToPirep($pirep, $brief); $sbSvc->attachSimbriefToPirep($pirep, $brief);
}
} }
// Depending on the button they selected, set an initial state // Depending on the button they selected, set an initial state