Skip to content

Commit dfbe352

Browse files
authored
func typeToAny bug fix (Azure#20033)
* fix null pointer exception when generating changelog
1 parent 236a89a commit dfbe352

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

eng/tools/generator/autorest/model/changelog.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,12 @@ func removePattern(funcName string, returnValue string) string {
433433
}
434434

435435
func typeToAny(b *report.BreakingChanges, flag bool) []string {
436-
if b.IsEmpty() {
437-
return nil
436+
var items []string
437+
438+
if b == nil || b.IsEmpty() {
439+
return items
438440
}
439441

440-
var items []string
441442
if len(b.Structs) > 0 {
442443
for _, k := range sortChangeItem(b.Structs) {
443444
v := b.Structs[k]

0 commit comments

Comments
 (0)