fix-#2056:Added null checking using lodash

This commit is contained in:
Mohammed Rayan sailani 2023-09-24 20:38:57 +05:30
parent 63a47b1ad2
commit 3738d7dfd4
3 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,7 @@
"i18next": "^21.9.2",
"js-yaml": "^4.1.0",
"json-rpc-2.0": "^1.4.1",
"lodash": "^4.17.21",
"memory-cache": "^0.2.0",
"minecraft-ping-js": "^1.0.2",
"next": "^12.3.1",

View File

@ -35,6 +35,9 @@ dependencies:
json-rpc-2.0:
specifier: ^1.4.1
version: 1.5.1
lodash:
specifier: ^4.17.21
version: 4.17.21
memory-cache:
specifier: ^0.2.0
version: 0.2.0

View File

@ -1,3 +1,4 @@
import _ from "lodash";
import useSWR from "swr";
import { FiHardDrive } from "react-icons/fi";
import { useTranslation } from "next-i18next";
@ -16,7 +17,7 @@ export default function Disk({ options, expanded, refresh = 1500 }) {
return <Error options={options} />
}
if (!data) {
if (_.isEmpty(data)) {
return <Resource
icon={FiHardDrive}
value="-"