mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 17:47:46 +01:00
fix nil pointer issue
This commit is contained in:
parent
b69083ecd1
commit
473b85cffa
@ -51,12 +51,12 @@ type Storage struct {
|
||||
|
||||
//namespaces stores all name spaces on Clair, it should be initialised only once.
|
||||
type clairNamespaces struct {
|
||||
*sync.RWMutex
|
||||
sync.RWMutex
|
||||
l []string
|
||||
clair *clair.Client
|
||||
}
|
||||
|
||||
func (n clairNamespaces) get() ([]string, error) {
|
||||
func (n *clairNamespaces) get() ([]string, error) {
|
||||
n.Lock()
|
||||
defer n.Unlock()
|
||||
if len(n.l) == 0 {
|
||||
@ -80,7 +80,7 @@ func (n clairNamespaces) get() ([]string, error) {
|
||||
}
|
||||
|
||||
var (
|
||||
namespaces clairNamespaces
|
||||
namespaces = &clairNamespaces{}
|
||||
)
|
||||
|
||||
//GeneralInfo wraps common systeminfo for anonymous request
|
||||
|
Loading…
Reference in New Issue
Block a user