X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8b2d407ef1f52d42ca30d8f5e23c7a4277a2acd5..cd64751cac4c56591bee9b0a9c2a626ce40e67db:/stglibs/srvconf.lib/parser_send_message.cpp?ds=sidebyside diff --git a/stglibs/srvconf.lib/parser_send_message.cpp b/stglibs/srvconf.lib/parser_send_message.cpp index 77aba248..2e2f785a 100644 --- a/stglibs/srvconf.lib/parser_send_message.cpp +++ b/stglibs/srvconf.lib/parser_send_message.cpp @@ -48,9 +48,12 @@ depth--; //----------------------------------------------------------------------------- void PARSER_SEND_MESSAGE::ParseAnswer(const char * /*el*/, const char **attr) { +if (!callback) + return; if (attr && attr[0] && attr[1]) - if (callback) - callback(attr[1], data); + callback(strcasecmp(attr[1], "ok") == 0, attr[1], data); +else + callback(false, "Invalid response.", data); } //----------------------------------------------------------------------------- void PARSER_SEND_MESSAGE::SetCallback(CALLBACK f, void * d)