From 306a80cf5727893fde366fa8954ee93c03d60d6b Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Sat, 16 Oct 2021 11:14:37 -0400 Subject: [PATCH] Bugfix: when namespace destruction causes a database error, return the error, not nil. --- namespaces.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/namespaces.go b/namespaces.go index e109b9a7..4d996bb0 100644 --- a/namespaces.go +++ b/namespaces.go @@ -59,7 +59,7 @@ func (h *Headscale) DestroyNamespace(name string) error { } if result := h.db.Unscoped().Delete(&n); result.Error != nil { - return err + return result.Error } return nil