Allow set NULL codec engine
[anna.git] / source / diameter / codec / Message.cpp
index 6593dd4..5849196 100644 (file)
@@ -84,7 +84,7 @@ Message::~Message() {
 //------------------------------------------------------------------------------
 void Message::setEngine(Engine *engine) throw() {
 
-  if (a_engine && engine != a_engine) {
+  if (a_engine && 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;
   }