Index: trunk/extensions/CodeReview/backend/CodeRepository.php |
— | — | @@ -260,6 +260,9 @@ |
261 | 261 | * @param $useCache 'skipcache' to avoid caching |
262 | 262 | * 'cached' to *only* fetch if cached |
263 | 263 | * @return string|int The diff text on success, a DIFFRESULT_* constant on failure. |
| 264 | + * @fixme Actually returns null if $useCache='cached' and there's no cached |
| 265 | + * data. Either add a relevant constant or fix the comment above; |
| 266 | + * caller in CodeRevisionView fixed by adding is_null check. |
264 | 267 | */ |
265 | 268 | public function getDiff( $rev, $useCache = '' ) { |
266 | 269 | global $wgMemc, $wgCodeReviewMaxDiffPaths; |
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -365,7 +365,7 @@ |
366 | 366 | $cache = ''; |
367 | 367 | } |
368 | 368 | $diff = $this->mRepo->getDiff( $this->mRev->getId(), $cache ); |
369 | | - if ( is_integer($diff) && $deferDiffs ) { |
| 369 | + if ( (is_null($diff) || is_integer($diff)) && $deferDiffs ) { |
370 | 370 | // We'll try loading it by AJAX... |
371 | 371 | return $this->stubDiffLoader(); |
372 | 372 | } elseif ( strlen( $diff ) > $wgCodeReviewMaxDiffSize ) { |