Explorar o código

null -> undefined

visuddhinanda %!s(int64=3) %!d(string=hai) anos
pai
achega
61b8d32c49
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      dashboard/src/components/template/utilities.ts

+ 2 - 2
dashboard/src/components/template/utilities.ts

@@ -89,9 +89,9 @@ export function XmlToReact(
         case 2: //attribute node
           return [];
         case 3: //text node
-          let textValue = value.nodeValue;
+          let textValue = value.nodeValue ? value.nodeValue : undefined;
           //编码转换
-          if (typeof convertor !== "undefined") {
+          if (typeof convertor !== "undefined" && textValue !== null) {
             switch (convertor) {
               case "roman_to_my":
                 textValue = roman_to_my(textValue);