From 0c8c69e28651b7fecbfe19ee830a442b94a20992 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Tue, 8 Oct 2013 20:33:35 +0000 Subject: [PATCH] --bug --- go/r3-eventbroker_zmq/metamovement.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/go/r3-eventbroker_zmq/metamovement.go b/go/r3-eventbroker_zmq/metamovement.go index a24d4ed..3ccfd72 100644 --- a/go/r3-eventbroker_zmq/metamovement.go +++ b/go/r3-eventbroker_zmq/metamovement.go @@ -30,7 +30,11 @@ func MetaEventRoutine_Movement(ps *pubsub.PubSub, granularity, gran_duration int case event := <- events_chan: switch event.(type) { case r3events.MovementSensorUpdate: - movement_window.Value = (uint32) (movement_window.Value.(uint32) + 1) + if movement_window.Value == nil { + movement_window.Value = uint32(1) + } else { + movement_window.Value = uint32(movement_window.Value.(uint32) + 1) + } } case gots := <- myticker.C: ts := gots.Unix() -- 1.7.10.4