X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=source%2Fdiameter%2Fcodec%2FMessage.cpp;h=28a1d4587d27f6618c5170be15fe1bd390ec0fc0;hb=5bf5055ab79aaf464e2491cfbab173ba37ba3419;hp=6593dd4626d22472995683a626ef1108abddf2d3;hpb=8a83c3072f9c073ad0b29e79c19ca88e1ac636d9;p=anna.git diff --git a/source/diameter/codec/Message.cpp b/source/diameter/codec/Message.cpp index 6593dd4..28a1d45 100644 --- a/source/diameter/codec/Message.cpp +++ b/source/diameter/codec/Message.cpp @@ -84,7 +84,12 @@ Message::~Message() { //------------------------------------------------------------------------------ void Message::setEngine(Engine *engine) throw() { - if (a_engine && engine != a_engine) { + if (!engine) { + LOGWARNING(anna::Logger::warning("Ignored: you must assign a valid codec engine. If you want to set NULL engine, clear the message", ANNA_FILE_LOCATION)); + return; + } + + if (a_engine && (engine != a_engine)) { LOGWARNING(anna::Logger::warning("Ignored: it is not a good practice to change the codec engine once assigned. Clear the message first to set the engine again.", ANNA_FILE_LOCATION)); return; }