Skip to content

Commit d030db7

Browse files
committed
fix platform release being nil and causing panic with indexes not compliant with specs
1 parent 70d9611 commit d030db7

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

commands/core/list.go

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

5557
if platformRelease != nil {

i18n/data/en.po

+1-1
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:58
3300+
#: commands/core/list.go:60
33013301
msgid "the platform has no releases"
33023302
msgstr "the platform has no releases"
33033303

0 commit comments

Comments
 (0)