aboutsummaryrefslogtreecommitdiff
path: root/cmd/mi/models/switch.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/mi/models/switch.go')
-rw-r--r--cmd/mi/models/switch.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/mi/models/switch.go b/cmd/mi/models/switch.go
index ec85a1c..5a16dd6 100644
--- a/cmd/mi/models/switch.go
+++ b/cmd/mi/models/switch.go
@@ -17,7 +17,11 @@ type Switch struct {
}
// AsProto converts a Switch to its protobuf representation.
-func (s Switch) AsProto() *pb.Switch {
+func (s *Switch) AsProto() *pb.Switch {
+ if s == nil {
+ return nil
+ }
+
var endedAt string
if s.EndedAt != nil {