From 46bdde8a8f6612417c3ed0cf3d04407a2e2b9503 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Fri, 27 Aug 2021 00:24:50 +0200 Subject: [PATCH] api: Remove redundant truthy check in ApiComparePages If there is no content the if before would already throw with dieWithError Change-Id: I370aa6c6d33b372b03bfff0a5f1f02f391a6788a --- includes/api/ApiComparePages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php index 3c2e9b8aed9..120acf445e0 100644 --- a/includes/api/ApiComparePages.php +++ b/includes/api/ApiComparePages.php @@ -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 ) ],