bugfix: Adjust error comparison in builtin stores (#975)

This commit is contained in:
Ian Mckay
2024-03-07 08:26:51 +11:00
committed by GitHub
parent d7904a3317
commit 2a5636fa4e
3 changed files with 3 additions and 3 deletions

View File

@@ -125,7 +125,7 @@ func (db *DB) BlueprintByName(name string) (*blueprint.Blueprint, error) {
return &notFound{"Blueprint", fmt.Sprintf("name %s", name)}
}
v := b.Get(idx)
if idx == nil {
if v == nil {
return &notFound{"Blueprint", fmt.Sprintf("uuid %s", string(idx))}
}
return blueprint.UnmarshalBlueprint(v, &bp)

View File

@@ -185,7 +185,7 @@ func (db *DB) deviceByIndex(key string) (*device.Device, error) {
return &notFound{"Device", fmt.Sprintf("key %s", key)}
}
v := b.Get(idx)
if idx == nil {
if v == nil {
return &notFound{"Device", fmt.Sprintf("uuid %s", string(idx))}
}
return device.UnmarshalDevice(v, &dev)

View File

@@ -122,7 +122,7 @@ func (db *DB) UserByUserID(userID string) (*user.User, error) {
return &notFound{"User", fmt.Sprintf("user id %s", userID)}
}
v := b.Get(idx)
if idx == nil {
if v == nil {
return &notFound{"User", fmt.Sprintf("uuid %s", string(idx))}
}
return user.UnmarshalUser(v, &u)