ForeignNotifications: Fix fatal when one section has no timestamp

Bug: T133921
Change-Id: Iab82fa9439e26832731f4f56b5be18985203f49c
This commit is contained in:
Roan Kattouw 2016-04-28 10:16:38 -07:00
parent fbf702aa7e
commit e864b1fc47

View file

@ -88,7 +88,7 @@ class EchoForeignNotifications {
foreach ( $this->timestamps as $timestamp ) {
// $timestamp < $max = invert 0
// $timestamp > $max = invert 1
if ( $max === false || $timestamp->diff( $max )->invert === 1 ) {
if ( $timestamp !== false && ( $max === false || $timestamp->diff( $max )->invert === 1 ) ) {
$max = $timestamp;
}
}