Validate the handler for changing the visibility
authorSung-jae Park <nicesj.park@samsung.com>
Sat, 24 Nov 2012 02:18:10 +0000 (11:18 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Sat, 24 Nov 2012 02:48:54 +0000 (11:48 +0900)
Change-Id: Ifc55039e770a4a9e094f1595a2ae0fa2d8a3f38a

packaging/liblivebox-viewer.spec
src/livebox.c

index 8093cac..62d516a 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-viewer
 Summary: Library for the development of a livebox viewer
-Version: 0.8.2
+Version: 0.8.3
 Release: 1
 Group: main/app
 License: Samsung Proprietary License
index 0775168..14edeaf 100644 (file)
@@ -697,7 +697,7 @@ EAPI int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb,
 {
        struct packet *packet;
 
-       if (!handler || !handler->id || handler->state != CREATE) {
+       if (!handler || handler->state != CREATE || !handler->id) {
                ErrPrint("Handler is not valid\n");
                return -EINVAL;
        }
@@ -1173,7 +1173,7 @@ EAPI const char *livebox_filename(struct livebox *handler)
                return NULL;
        }
 
-       if (handler->state != CREATE) {
+       if (handler->state != CREATE || !handler->id) {
                ErrPrint("Handler is not valid\n");
                return NULL;
        }
@@ -1996,7 +1996,7 @@ EAPI int livebox_set_visibility(struct livebox *handler, enum livebox_visible_st
                return -EINVAL;
        }
 
-       if (handler->state != CREATE)
+       if (handler->state != CREATE || !handler->id)
                return -EINVAL;
 
        if (!handler->is_user) {