diff --git a/var/Typecho/I18n/GetText.php b/var/Typecho/I18n/GetText.php index 677a80ed95..8e91afd4f5 100644 --- a/var/Typecho/I18n/GetText.php +++ b/var/Typecho/I18n/GetText.php @@ -394,7 +394,8 @@ private function getPluralForms(): string } else { $header = $this->getTranslationString(0); } - if (preg_match("/plural\-forms: ([^\n]*)\n/i", $header, $regs)) { + + if (!is_null($header) && preg_match("/plural\-forms: ([^\n]*)\n/i", $header, $regs)) { $expr = $regs[1]; } else { $expr = "nplurals=2; plural=n == 1 ? 0 : 1;";