From da4b70dedf69c195eb4eabfcdf68dbdfd54c533a Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 24 Nov 2018 15:37:31 +0100 Subject: [PATCH] Fix editing language item via PIP GUI if it has been missing in a language See #2545 --- .../LanguagePackageInstallationPlugin.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php index e7abe21e86..1837bc08c5 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php @@ -814,12 +814,13 @@ XML; // replace old element $element = $this->getElementByIdentifier($xml, $identifier); - - if ($element->parentNode === $newElement->parentNode) { - DOMUtil::replaceElement($element, $newElement, false); - } - else { - DOMUtil::removeNode($element); + if ($element !== null) { + if ($element->parentNode === $newElement->parentNode) { + DOMUtil::replaceElement($element, $newElement, false); + } + else { + DOMUtil::removeNode($element); + } } return $newElement; -- 2.20.1