Index: trunk/phase3/includes/api/ApiComparePages.php |
— | — | @@ -53,7 +53,13 @@ |
54 | 54 | $vals['torevid'] = $rev2; |
55 | 55 | |
56 | 56 | $difftext = $de->getDiffBody(); |
57 | | - ApiResult::setContent( $vals, $difftext ); |
| 57 | + |
| 58 | + if ( $difftext === false ) { |
| 59 | + $this->dieUsage( 'The diff cannot be retrieved. ' . |
| 60 | + 'Maybe one or both revisions do not exist or you do not have permission to view them.', 'baddiff' ); |
| 61 | + } else { |
| 62 | + ApiResult::setContent( $vals, $difftext ); |
| 63 | + } |
58 | 64 | |
59 | 65 | $this->getResult()->addValue( null, $this->getModuleName(), $vals ); |
60 | 66 | } |