Change empty phrase name exception type
authorTim Düsterhus <duesterhus@woltlab.com>
Sun, 9 Feb 2020 14:15:14 +0000 (15:15 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Sun, 9 Feb 2020 14:15:14 +0000 (15:15 +0100)
WoltLab Suite 5.2 already has a check for a category mismatch
that throws an Exception of type InvalidArgumentException. Change
this one for consistency.

see 9e280cb5c1dd3e398a3096b55f6d88be4baa6923
see e3d24f95b721e38ab205c89769c3b015aa43d75c

wcfsetup/install/files/lib/data/language/LanguageEditor.class.php

index 32c9a0d0e2733dc9343cf9c5c3af766a30876601..a60d4e332a17603037079cedd497dd75f6674ae1 100644 (file)
@@ -313,7 +313,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
                                        
                                        // Safeguard against malformed phrases, an empty name has a strange side effect.
                                        if (empty($itemName)) {
-                                               throw new \RuntimeException("The name attribute is missing or empty.");
+                                               throw new \InvalidArgumentException("The name attribute is missing or empty.");
                                        }
                                        
                                        $itemValue = $element->nodeValue;