Skip to content

Commit b3f47f8

Browse files
committed
[topic] fix missing map initialization
1 parent c17eab3 commit b3f47f8

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

internal/grpcwrapper/rawtopic/describe_topic.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ func (res *DescribeTopicResult) FromProto(protoResponse *Ydb_Topic.DescribeTopic
6969
}
7070
}
7171

72+
res.Attributes = make(map[string]string)
7273
for k, v := range protoResult.Attributes {
7374
res.Attributes[k] = v
7475
}

topic/topictypes/topictypes.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ func (d *TopicDescription) FromRaw(raw *rawtopic.DescribeTopicResult) {
146146

147147
d.PartitionWriteSpeedBytesPerSecond = raw.PartitionWriteSpeedBytesPerSecond
148148
d.PartitionWriteBurstBytes = raw.PartitionWriteBurstBytes
149+
150+
d.Attributes = make(map[string]string)
149151
for k, v := range raw.Attributes {
150152
d.Attributes[k] = v
151153
}
@@ -172,6 +174,8 @@ func (d *TopicDescription) ToRaw(raw *rawtopic.DescribeTopicResult) {
172174

173175
raw.PartitionWriteBurstBytes = d.PartitionWriteBurstBytes
174176
raw.PartitionWriteSpeedBytesPerSecond = d.PartitionWriteSpeedBytesPerSecond
177+
178+
raw.Attributes = make(map[string]string)
175179
for k, v := range d.Attributes {
176180
raw.Attributes[k] = v
177181
}

0 commit comments

Comments
 (0)