diff options
-rw-r--r-- | libpod/sql_state.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/sql_state.go b/libpod/sql_state.go index 5248ee87a..9d457c3ec 100644 --- a/libpod/sql_state.go +++ b/libpod/sql_state.go @@ -511,6 +511,10 @@ func (s *SQLState) SaveContainer(ctr *Container) error { NetNSPath=? WHERE Id=?;` + if !ctr.valid { + return ErrCtrRemoved + } + netNSPath := "" if ctr.state.NetNS != nil { netNSPath = ctr.state.NetNS.Path() @@ -520,10 +524,6 @@ func (s *SQLState) SaveContainer(ctr *Container) error { return ErrDBClosed } - if !ctr.valid { - return ErrCtrRemoved - } - tx, err := s.db.Begin() if err != nil { return errors.Wrapf(err, "error beginning database transaction") |