Explorar el Código

fix: modbus物模型

wzyyy hace 3 años
padre
commit
cbc1135ec3
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/pages/device/Instance/Detail/Modbus/index.tsx

+ 1 - 1
src/pages/device/Instance/Detail/Modbus/index.tsx

@@ -222,7 +222,7 @@ export default (props: Props) => {
     });
   }, []);
   useEffect(() => {
-    const metadata = JSON.parse(data.metadata).properties?.map((item: any) => ({
+    const metadata = JSON.parse(data.metadata || '{}').properties?.map((item: any) => ({
       metadataId: item.id,
       metadataName: `${item.name}(${item.id})`,
       metadataType: 'property',