- } else {
- if (ret.status == BT_QUERY_STATUS_EXECUTOR_CANCELED) {
- /*
- * The user cannot decide that the executor is
- * canceled if it's not.
- */
- BT_OBJECT_PUT_REF_AND_RESET(ret.result);
- ret.status = BT_QUERY_STATUS_ERROR;
- goto end;
- }
- }
-
- switch (ret.status) {
- case BT_QUERY_STATUS_INVALID:
- /*
- * This is reserved for invalid parameters passed to
- * this function.
- */
- BT_OBJECT_PUT_REF_AND_RESET(ret.result);
- ret.status = BT_QUERY_STATUS_ERROR;
- break;
- case BT_QUERY_STATUS_OK:
- if (!ret.result) {
- ret.result = bt_value_null;
- }
- break;
- default:
- if (ret.result) {
- BT_LOGW("User method did not return BT_QUERY_STATUS_OK, but result is not NULL: "
- "status=%s, result-addr=%p",
- bt_query_status_string(ret.status), ret.result);
- BT_OBJECT_PUT_REF_AND_RESET(ret.result);
- }