Skip to content

Commit 318425f

Browse files
committed
Fix for issue #21510
1 parent 7d0efc5 commit 318425f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/code/Magento/Indexer/Model/Indexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ public function getLatestUpdated()
361361
return $this->getView()->getUpdated();
362362
}
363363
}
364-
return $this->getState()->getUpdated();
364+
return $this->getState()->getUpdated() ?: '';
365365
}
366366

367367
/**

app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ public function testGetLatestUpdated($getViewIsEnabled, $getViewGetUpdated, $get
164164
}
165165
}
166166
} else {
167-
$this->assertEquals($getStateGetUpdated, $this->model->getLatestUpdated());
167+
$actualGetLatestUpdated = $this->model->getLatestUpdated();
168+
$this->assertEquals($getStateGetUpdated, $actualGetLatestUpdated);
169+
170+
if ($getStateGetUpdated === null) {
171+
$this->assertNotNull($actualGetLatestUpdated);
172+
}
168173
}
169174
}
170175

@@ -182,7 +187,8 @@ public function getLatestUpdatedDataProvider()
182187
[true, '', '06-Jan-1944'],
183188
[true, '06-Jan-1944', ''],
184189
[true, '', ''],
185-
[true, '06-Jan-1944', '05-Jan-1944']
190+
[true, '06-Jan-1944', '05-Jan-1944'],
191+
[false, null, null],
186192
];
187193
}
188194

0 commit comments

Comments
 (0)