UnreadWikis: Check the actual object we're about to call a method on

In principle, if $alertCount > 0, $alertTime should never be null,
but it feels much safer to check $alertTime itself instead.

Change-Id: Ifb107e257fbcd65e8181e2a214028f1b3733ac30
This commit is contained in:
Roan Kattouw 2018-05-26 12:50:23 +02:00 committed by Aaron Schulz
parent e29d1253b3
commit 544129492d

View file

@ -115,11 +115,11 @@ class EchoUnreadWikis {
if ( $alertCount || $msgCount ) {
$values = [
'euw_alerts' => $alertCount,
'euw_alerts_ts' => $alertCount
'euw_alerts_ts' => $alertTime
? $alertTime->getTimestamp( TS_MW )
: static::DEFAULT_TS,
'euw_messages' => $msgCount,
'euw_messages_ts' => $msgCount
'euw_messages_ts' => $msgTime
? $msgTime->getTimestamp( TS_MW )
: static::DEFAULT_TS,
];