File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,27 @@ static GglError subscribe_to_topic_resp_handler(
8989 GglBuffer topic = ggl_obj_into_buf (* topic_obj );
9090
9191 if (is_json ) {
92+ if (callbacks -> json_handler == NULL ) {
93+ GGL_LOGW (
94+ "Skipping unhandled JSON payload on local topic %.*s." ,
95+ (int ) topic .len ,
96+ topic .data
97+ );
98+ return GGL_ERR_OK ;
99+ }
100+
92101 GglMap payload = ggl_obj_into_map (* message_obj );
93102 callbacks -> json_handler (topic , payload , handle );
94103 } else {
104+ if (callbacks -> json_handler == NULL ) {
105+ GGL_LOGW (
106+ "Skipping unhandled binary payload on local topic %.*s." ,
107+ (int ) topic .len ,
108+ topic .data
109+ );
110+ return GGL_ERR_OK ;
111+ }
112+
95113 GglBuffer payload = ggl_obj_into_buf (* message_obj );
96114 if (!ggl_base64_decode_in_place (& payload )) {
97115 GGL_LOGE ("Failed to decode pubsub subscription response payload." );
You can’t perform that action at this time.
0 commit comments