|
@@ -1,6 +1,7 @@
|
|
|
package main
|
|
|
|
|
|
import (
|
|
|
+ "errors"
|
|
|
"github.com/garyburd/redigo/redis"
|
|
|
"sparrow/pkg/online"
|
|
|
"sparrow/pkg/rpcs"
|
|
@@ -60,6 +61,10 @@ func (dm *DeviceManager) GetDeviceOnlineStatus(args rpcs.ArgsGetDeviceOnlineStat
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
+ if status == nil {
|
|
|
+ return errors.New("device not online")
|
|
|
+ }
|
|
|
+
|
|
|
reply.ClientIP = status.ClientIP
|
|
|
reply.AccessRPCHost = status.AccessRPCHost
|
|
|
reply.HeartbeatInterval = status.HeartbeatInterval
|