Index: trunk/extensions/LiquidThreads/classes/NewMessagesController.php |
— | — | @@ -397,17 +397,20 @@ |
398 | 398 | |
399 | 399 | $res = $dbr->select( 'user_message_state', '1', $cond, __METHOD__, $options ); |
400 | 400 | |
401 | | - $count = $res->numRows(); |
| 401 | + if( $res ) { |
| 402 | + $count = $res->numRows(); |
402 | 403 | |
403 | | - if ( $count >= 500 ) { |
404 | | - $count = $dbr->estimateRowCount( 'user_message_state', '*', $cond, |
| 404 | + if ( $count >= 500 ) { |
| 405 | + $count = $dbr->estimateRowCount( 'user_message_state', '*', $cond, |
405 | 406 | __METHOD__ ); |
406 | | - } |
| 407 | + } |
407 | 408 | |
408 | | - $wgMemc->set( wfMemcKey( 'lqt-new-messages-count', $user->getId() ), |
| 409 | + $wgMemc->set( wfMemcKey( 'lqt-new-messages-count', $user->getId() ), |
409 | 410 | $count, 86400 ); |
410 | 411 | |
411 | | - return $count; |
| 412 | + return $count; |
| 413 | + } |
| 414 | + return 0; |
412 | 415 | } |
413 | 416 | |
414 | 417 | static function recacheMessageCount( $uid ) { |