@@ -1837,14 +1837,21 @@ void Tango::EventConsumer::initialize_received_from_admin(const Tango::DevVarLon
18371837 const string &adm_name,
18381838 bool device_from_env_var)
18391839{
1840+ if (dvlsa->lvalue .length () == 0 )
1841+ {
1842+ EventSystemExcept::throw_exception (API_NotSupported,
1843+ " Server did not send its tango lib version. The server is possibly too old. The event system is not initialized!" ,
1844+ " EventConsumer::initialize_received_from_admin()" );
1845+ }
1846+
18401847 long server_tango_lib_ver = dvlsa->lvalue [0 ];
18411848
18421849 // event name is used for zmq topics filtering
18431850 // channel name is used for heartbeat events
18441851 if (server_tango_lib_ver >= 930 )
18451852 {
18461853 received_from_admin.event_name = (dvlsa->svalue [dvlsa->svalue .length () - 2 ]);
1847- received_from_admin.channel_name = (dvlsa->svalue [dvlsa->svalue .length () - 1 ]);
1854+ received_from_admin.channel_name = (dvlsa->svalue [dvlsa->svalue .length () - 1 ]);
18481855 }
18491856 else
18501857 {
@@ -1860,9 +1867,21 @@ void Tango::EventConsumer::initialize_received_from_admin(const Tango::DevVarLon
18601867 received_from_admin.channel_name = adm_name_lower;
18611868 }
18621869
1863- assert (!(received_from_admin.event_name .empty ()));
1870+ if (received_from_admin.event_name .empty ())
1871+ {
1872+ EventSystemExcept::throw_exception (API_NotSupported,
1873+ " Server did not send the event name. The server is possibly too old. The event system is not initialized!" ,
1874+ " EventConsumer::initialize_received_from_admin()" );
1875+
1876+ }
1877+
18641878 cout4 << " received_from_admin.event_name = " << received_from_admin.event_name << endl;
1865- assert (!(received_from_admin.channel_name .empty ()));
1879+ if (received_from_admin.channel_name .empty ())
1880+ {
1881+ EventSystemExcept::throw_exception (API_NotSupported,
1882+ " Server did not send the channel name. The server is possibly too old. The event system is not initialized!" ,
1883+ " EventConsumer::initialize_received_from_admin()" );
1884+ }
18661885 cout4 << " received_from_admin.channel_name = " << received_from_admin.channel_name << endl;
18671886}
18681887
0 commit comments