ppegusii / cs677-smart-homes-IoT

Programming Assignment 1: Internet of Things and Smart Homes
GNU General Public License v2.0
2 stars 0 forks source link

testing bug 1: sendState() call in ChangeState() gives panic #33

Open ameetrivedi opened 9 years ago

ameetrivedi commented 9 years ago

Now, sendstate() is an RPC call and no more going through In test: tests/motion_home.json there is a call to sendstate() from Changestate() which results in panic.

2015/05/07 05:55:15 Current state: Motion panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x20 pc=0x3e96]

goroutine 9 [running]: main.(_MotionSensor).sendState(0xc2080c8000) /Users/ameetrivedi/Desktop/Amee/Projects/CS677/Lab2/src/github.com/ppegusii/cs677-smart-homes-IoT/motionsensor/motionsensor.go:194 +0x196 main.(_MotionSensor).ChangeState(0xc2080c8000, 0xc20801f2c0, 0xc20801f400, 0x0, 0x0) /Users/ameetrivedi/Desktop/Amee/Projects/CS677/Lab2/src/github.com/ppegusii/cs677-smart-homes-IoT/motionsensor/motionsensor.go:128 +0x20d reflect.Value.call(0x329960, 0x394d70, 0x13, 0x3c6190, 0x4, 0xc2080a3f28, 0x3, 0x3, 0x0, 0x0, ...) /usr/local/go/src/reflect/value.go:419 +0x10e5 reflect.Value.Call(0x329960, 0x394d70, 0x13, 0xc2080a3f28, 0x3, 0x3, 0x0, 0x0, 0x0) /usr/local/go/src/reflect/value.go:296 +0xbc