From f2b3ce238b4e521ebf0e3221f0fbfc9c81c5e6b4 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Tue, 12 Oct 2021 20:50:35 +0100 Subject: [PATCH] cache: add panic if row to be deleted isn't in cache Signed-off-by: Dave Tucker --- cache/cache.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cache/cache.go b/cache/cache.go index e4c444cb..b8101f8b 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -611,6 +611,9 @@ func (t *TableCache) Populate2(tableUpdates ovsdb.TableUpdates2) { // If everything else is nil (including Delete because it's a key with // no value on the wire), then process a delete m := tCache.Row(uuid) + if m == nil { + panic(fmt.Errorf("row with uuid %s does not exist", uuid)) + } if err := tCache.Delete(uuid); err != nil { panic(err) }