Check that $incidentDate is set before using it

This commit is contained in:
James Brooks 2015-09-21 11:21:03 +01:00
parent a9a5eef275
commit 80caeea86a

View File

@ -126,10 +126,12 @@ class IncidentController extends Controller
Binput::get('notify', true)
));
$incident->update([
'created_at' => $incidentDate,
'updated_at' => $incidentDate,
]);
if (isset($incidentDate)) {
$incident->update([
'created_at' => $incidentDate,
'updated_at' => $incidentDate,
]);
}
} catch (ValidationException $e) {
return Redirect::route('dashboard.incidents.add')
->withInput(Binput::all())