Diffs: avoid getContentHandler on null error

Bug: T388708
Change-Id: I4dbbeb70a53c6ca0b3c44995d13e2c5de097ddf2
(cherry picked from commit 7aee965efdbe316f8ea13b1d03b4c1afab11d255)
This commit is contained in:
Pppery 2025-04-03 17:13:14 -04:00 committed by Reedy
parent 810a248988
commit 65d32263fd

View file

@ -319,6 +319,10 @@ class DifferenceEngine extends ContextSource {
// Do not produce a diff of identical content
continue;
}
if ( !$contents['new'] && !$contents['old'] ) {
// Nothing to diff (i.e both revisions are corrupted), just ignore
continue;
}
$handler = ( $contents['new'] ?: $contents['old'] )->getContentHandler();
$this->slotDiffRenderers[$role] = $handler->getSlotDiffRenderer(
$this->getContext(),