Fixed low-level bug that failed to deal with null/empty hashing.

Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
Dave Shanley
2023-08-09 07:33:19 -04:00
committed by quobix
parent f7ab737f0a
commit f05abdbcb5
2 changed files with 9 additions and 0 deletions

View File

@@ -698,6 +698,9 @@ func AreEqual(l, r Hashable) bool {
// GenerateHashString will generate a SHA36 hash of any object passed in. If the object is Hashable
// then the underlying Hash() method will be called.
func GenerateHashString(v any) string {
if v == nil {
return ""
}
if h, ok := v.(Hashable); ok {
if h != nil {
return fmt.Sprintf(HASH, h.Hash())