aboutsummaryrefslogtreecommitdiff
path: root/light.go
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-09 23:40:00 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-09 23:40:00 -0500
commit3ea47fb394b71978b15e44166f1abed05e83cbc5 (patch)
tree4b6c7ccfbd9f33614ca7341304d98d1f6609ed4d /light.go
parent0533ebfe36133e9ab300bd72b56c3c1427fff7c6 (diff)
Attempt to fix memory error with SetName.
Diffstat (limited to 'light.go')
-rw-r--r--light.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/light.go b/light.go
index cc8a112..7396dd1 100644
--- a/light.go
+++ b/light.go
@@ -56,7 +56,10 @@ func (self *Light) SetName(name string) error {
body := make(map[string]string)
body["name"] = name
_, _, err := self.Bridge.Put(uri, body)
- return err
+ if err != nil {
+ return err
+ }
+ return nil
}
// Light.Off will turn the light source off