Skip to content

Commit 2065c3f

Browse files
committed
fix platform release being nil and causing panic with indexes not compliant with specs
1 parent 0364b07 commit 2065c3f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

commands/core/list.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ func GetPlatforms(req *rpc.PlatformListRequest) ([]*rpc.Platform, error) {
4545
} else {
4646
installedVersion = platformRelease.Version.String()
4747
}
48-
rpcPlatform := commands.PlatformReleaseToRPC(platform.GetLatestRelease())
49-
rpcPlatform.Installed = installedVersion
50-
res = append(res, rpcPlatform)
51-
continue
48+
if platformRelease != nil {
49+
rpcPlatform := commands.PlatformReleaseToRPC(platformRelease)
50+
rpcPlatform.Installed = installedVersion
51+
res = append(res, rpcPlatform)
52+
continue
53+
}
5254
}
5355

5456
if platformRelease != nil {

i18n/data/en.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3297,7 +3297,7 @@ msgstr "testing local archive integrity: %s"
32973297
msgid "text section exceeds available space in board"
32983298
msgstr "text section exceeds available space in board"
32993299

3300-
#: commands/core/list.go:57
3300+
#: commands/core/list.go:59
33013301
msgid "the platform has no releases"
33023302
msgstr "the platform has no releases"
33033303

0 commit comments

Comments
 (0)