File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -45,18 +45,17 @@ func printJson(res any) {
45
45
func PrintOtaStatus (otaid , device string , wideOutput bool , cred * config.Credentials ) error {
46
46
otapi := otaapi .NewClient (cred )
47
47
48
- var res any
49
48
var err error
50
49
if otaid != "" {
51
- res , err = otapi .GetOtaStatusByOtaID (otaid )
52
- if err == nil {
53
- formatOutput (wideOutput , res .( * otaapi. OtaStatusResponse ). Ota )
50
+ res , err : = otapi .GetOtaStatusByOtaID (otaid )
51
+ if err == nil && res != nil {
52
+ formatOutput (wideOutput , res .Ota )
54
53
}
55
54
}
56
55
if device != "" {
57
- res , err = otapi .GetOtaStatusByDeviceID (device )
58
- if err == nil {
59
- formatOutputSlice (wideOutput , res .( * otaapi. OtaStatusByDeviceResponse ). Ota )
56
+ res , err : = otapi .GetOtaStatusByDeviceID (device )
57
+ if err == nil && res != nil {
58
+ formatOutputSlice (wideOutput , res .Ota )
60
59
}
61
60
}
62
61
if err != nil {
You can’t perform that action at this time.
0 commit comments