diff --git a/common/persistence/cassandra/cassandraClusterMetadata.go b/common/persistence/cassandra/cassandraClusterMetadata.go index cb1e0565c3b..58fc52b08b5 100644 --- a/common/persistence/cassandra/cassandraClusterMetadata.go +++ b/common/persistence/cassandra/cassandraClusterMetadata.go @@ -159,7 +159,7 @@ func (m *cassandraClusterMetadata) GetClusterMetadata() (*p.InternalGetClusterMe return nil, convertCommonErrors("GetClusterMetadata", err) } // TODO(vitarb): immutable metadata is needed for backward compatibility only, remove after 1.1 release. - if clusterMetadata == nil { + if len(clusterMetadata) == 0 { clusterMetadata = immutableMetadata encoding = immutableMetadataEncoding // Version can only be 0 for legacy records that have NULL version in the DB. diff --git a/common/persistence/sql/sqlClusterMetadataManager.go b/common/persistence/sql/sqlClusterMetadataManager.go index 23c51048eea..1e1cb25fca7 100644 --- a/common/persistence/sql/sqlClusterMetadataManager.go +++ b/common/persistence/sql/sqlClusterMetadataManager.go @@ -51,7 +51,7 @@ func (s *sqlClusterMetadataManager) GetClusterMetadata() (*p.InternalGetClusterM } // TODO(vitarb): immutable metadata is needed for backward compatibility only, remove after 1.1 release. - if row.Data == nil { + if len(row.Data) == 0 { row.Data = row.ImmutableData row.DataEncoding = row.ImmutableDataEncoding }