JobDetails: fix null issue

This commit is contained in:
Thomas Gelf 2021-12-06 21:36:56 +01:00
parent 37db546a0d
commit e27cda645d
1 changed files with 5 additions and 5 deletions

View File

@ -44,12 +44,12 @@ class JobDetails extends HtmlDocument
}
$tsLastAttempt = $job->get('ts_last_attempt');
$ts = \strtotime($tsLastAttempt);
$timeAgo = Html::tag('span', [
'class' => 'time-ago',
'title' => DateFormatter::formatDateTime($ts)
], DateFormatter::timeAgo($ts));
if ($tsLastAttempt) {
$ts = \strtotime($tsLastAttempt);
$timeAgo = Html::tag('span', [
'class' => 'time-ago',
'title' => DateFormatter::formatDateTime($ts)
], DateFormatter::timeAgo($ts));
if ($job->get('last_attempt_succeeded') === 'y') {
$this->add(Hint::ok(Html::sprintf(
$this->translate('The last attempt succeeded %s'),