mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-09 02:55:59 +08:00
bugfix: Adjust error comparison in builtin stores (#975)
This commit is contained in:
@@ -125,7 +125,7 @@ func (db *DB) BlueprintByName(name string) (*blueprint.Blueprint, error) {
|
||||
return ¬Found{"Blueprint", fmt.Sprintf("name %s", name)}
|
||||
}
|
||||
v := b.Get(idx)
|
||||
if idx == nil {
|
||||
if v == nil {
|
||||
return ¬Found{"Blueprint", fmt.Sprintf("uuid %s", string(idx))}
|
||||
}
|
||||
return blueprint.UnmarshalBlueprint(v, &bp)
|
||||
|
||||
@@ -185,7 +185,7 @@ func (db *DB) deviceByIndex(key string) (*device.Device, error) {
|
||||
return ¬Found{"Device", fmt.Sprintf("key %s", key)}
|
||||
}
|
||||
v := b.Get(idx)
|
||||
if idx == nil {
|
||||
if v == nil {
|
||||
return ¬Found{"Device", fmt.Sprintf("uuid %s", string(idx))}
|
||||
}
|
||||
return device.UnmarshalDevice(v, &dev)
|
||||
|
||||
@@ -122,7 +122,7 @@ func (db *DB) UserByUserID(userID string) (*user.User, error) {
|
||||
return ¬Found{"User", fmt.Sprintf("user id %s", userID)}
|
||||
}
|
||||
v := b.Get(idx)
|
||||
if idx == nil {
|
||||
if v == nil {
|
||||
return ¬Found{"User", fmt.Sprintf("uuid %s", string(idx))}
|
||||
}
|
||||
return user.UnmarshalUser(v, &u)
|
||||
|
||||
Reference in New Issue
Block a user