From c182c70b8dfb8d0e9f0030b724dd6b39aeea03ce Mon Sep 17 00:00:00 2001 From: UlricQin Date: Wed, 13 Jan 2021 10:10:00 +0800 Subject: [PATCH] bugfix: check node is nil --- src/models/node.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/models/node.go b/src/models/node.go index 976230fb..2089e14b 100644 --- a/src/models/node.go +++ b/src/models/node.go @@ -643,6 +643,10 @@ func GetRelatedNidsForMon(nid int64, exclNid []int64) ([]int64, error) { return nids, err } + if node == nil { + return nids, nil + } + nodes, err := node.RelatedNodes() if err != nil { return nids, err