File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -777,17 +777,18 @@ func (c *Client) getBearerStatus(bearerObj dbus.BusObject) (bearer types.WwanBea
777
777
bearer .ConnectedAt = uint64 (time .Now ().Unix ()) - uint64 (value )
778
778
}
779
779
}
780
- connectionError := struct {
781
- DBusErrName string
782
- ErrMessage string
783
- }{}
780
+
781
+ var connectionError []interface {}
784
782
_ = getDBusProperty (c , bearerObj , BearerPropertyConnectionError , & connectionError )
785
- if connectionError .DBusErrName != "" {
786
- if connectionError .ErrMessage != "" {
787
- bearer .ConnectionError = connectionError .DBusErrName + ": " +
788
- connectionError .ErrMessage
789
- } else {
790
- bearer .ConnectionError = connectionError .DBusErrName
783
+ if len (connectionError ) == 2 {
784
+ dbusErrName , ok1 := connectionError [0 ].(string )
785
+ errMessage , ok2 := connectionError [1 ].(string )
786
+ if ok1 && ok2 && dbusErrName != "" {
787
+ if errMessage != "" {
788
+ bearer .ConnectionError = dbusErrName + ": " + errMessage
789
+ } else {
790
+ bearer .ConnectionError = dbusErrName
791
+ }
791
792
}
792
793
}
793
794
var bearerProperties map [string ]dbus.Variant
You can’t perform that action at this time.
0 commit comments