diff --git a/namespaces.go b/namespaces.go index dc034cb4..e5d17839 100644 --- a/namespaces.go +++ b/namespaces.go @@ -68,7 +68,10 @@ func (h *Headscale) DestroyNamespace(name string) error { return err } for _, p := range keys { - h.DestroyPreAuthKey(&p) + err = h.DestroyPreAuthKey(&p) + if err != nil { + return err + } } if result := h.db.Unscoped().Delete(&n); result.Error != nil {