Fixed build error
[platform/core/api/zigbee.git] / test / main.c
index e0ed940..ab28b6a 100644 (file)
@@ -431,13 +431,13 @@ static void _zb_event_cb(zb_nwk_addr addr16, zb_ieee_addr addr64, zb_event_e e,
                                &type
                                );
                        msg("  type = [0x%02X][%s]", type, zb_zcl_get_data_type_str(type));
-                       zb_attr_report_get_value(
+                       ret = zb_attr_report_get_value(
                                records[j],
                                &type,
                                &buf,
                                &count
                                );
-                       if (ZIGBEE_ERROR_NONE == ret) {
+                       if (0 < count && ZIGBEE_ERROR_NONE == ret) {
                                for (i = 0; i < count; i++)
                                        msg("    0x%02X ", buf[i]);
                        }