Skip to content

Commit

Permalink
Fix potential bugs with empty node query
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Dec 20, 2024
1 parent f276c58 commit 0e0028c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions imports/dashboard/useOctyneData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ export const useOctyneAuth = (): OctyneDataWithAuth => {
const useOctyneData = (): OctyneData => {
const nodes = config.nodes ?? {}
const router = useRouter()
const server = router.query.server?.toString()
const node = router.query.node?.toString()
let server = router.query.server?.toString()
if (!server) server = undefined
let node = router.query.node?.toString()
if (!node) node = undefined
const ip = node ? nodes[node] : config.ip
const nodeExists = !node || !!(node && nodes[node])

Expand Down

0 comments on commit 0e0028c

Please sign in to comment.