api: Remove redundant truthy check in ApiComparePages

If there is no content the if before would already throw with
dieWithError

Change-Id: I370aa6c6d33b372b03bfff0a5f1f02f391a6788a
This commit is contained in:
Umherirrender 2021-08-27 00:24:50 +02:00
parent c56fcf5e33
commit 46bdde8a8f

View file

@ -455,7 +455,7 @@ class ApiComparePages extends ApiBase {
[ 'apierror-missingcontent-revid-role', $rev->getId(), SlotRecord::MAIN ], 'missingcontent'
);
}
$content = $content ? $content->getSection( $section ) : null;
$content = $content->getSection( $section );
if ( !$content ) {
$this->dieWithError(
[ "apierror-compare-nosuch{$prefix}section", wfEscapeWikiText( $section ) ],