From 59f77909b739e336ae14ce0b234ba78b82993d4a Mon Sep 17 00:00:00 2001 From: Nate Sales Date: Tue, 19 Nov 2024 23:56:28 -0500 Subject: [PATCH] fix: nil check on PCR measurement comparison --- pkg/models/models.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/models/models.go b/pkg/models/models.go index 8885b7a..61c6798 100644 --- a/pkg/models/models.go +++ b/pkg/models/models.go @@ -7,5 +7,5 @@ type Measurements struct { } func (m *Measurements) Equals(other *Measurements) bool { - return m.PCR0 == other.PCR0 && m.PCR1 == other.PCR1 && m.PCR2 == other.PCR2 + return (m != nil && other != nil) && m.PCR0 == other.PCR0 && m.PCR1 == other.PCR1 && m.PCR2 == other.PCR2 }