fix-#2056:Added null checking using lodash
This commit is contained in:
parent
63a47b1ad2
commit
3738d7dfd4
@ -20,6 +20,7 @@
|
|||||||
"i18next": "^21.9.2",
|
"i18next": "^21.9.2",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"json-rpc-2.0": "^1.4.1",
|
"json-rpc-2.0": "^1.4.1",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
"memory-cache": "^0.2.0",
|
"memory-cache": "^0.2.0",
|
||||||
"minecraft-ping-js": "^1.0.2",
|
"minecraft-ping-js": "^1.0.2",
|
||||||
"next": "^12.3.1",
|
"next": "^12.3.1",
|
||||||
|
|||||||
@ -35,6 +35,9 @@ dependencies:
|
|||||||
json-rpc-2.0:
|
json-rpc-2.0:
|
||||||
specifier: ^1.4.1
|
specifier: ^1.4.1
|
||||||
version: 1.5.1
|
version: 1.5.1
|
||||||
|
lodash:
|
||||||
|
specifier: ^4.17.21
|
||||||
|
version: 4.17.21
|
||||||
memory-cache:
|
memory-cache:
|
||||||
specifier: ^0.2.0
|
specifier: ^0.2.0
|
||||||
version: 0.2.0
|
version: 0.2.0
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import _ from "lodash";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { FiHardDrive } from "react-icons/fi";
|
import { FiHardDrive } from "react-icons/fi";
|
||||||
import { useTranslation } from "next-i18next";
|
import { useTranslation } from "next-i18next";
|
||||||
@ -16,7 +17,7 @@ export default function Disk({ options, expanded, refresh = 1500 }) {
|
|||||||
return <Error options={options} />
|
return <Error options={options} />
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data) {
|
if (_.isEmpty(data)) {
|
||||||
return <Resource
|
return <Resource
|
||||||
icon={FiHardDrive}
|
icon={FiHardDrive}
|
||||||
value="-"
|
value="-"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user