Routing 如何修复:check_和_cast():无法将空指针转换为类型';IPv4ControlInfo*&x27;

Routing 如何修复:check_和_cast():无法将空指针转换为类型';IPv4ControlInfo*&x27;,routing,omnet++,inet,Routing,Omnet++,Inet,这是我在AODVRouting.cc(已经在inet中)中实现的重播方法。当我启动模拟时,它会运行一段时间,但随后出现以下错误: check_and_cast(): cannot cast NULL pointer to type 'IPv4ControlInfo *' 这是我的方法: void AODVRouting::Replay (cMessage *msg) { std::cout<<"Mal Host Activity"<<endl;

这是我在AODVRouting.cc(已经在inet中)中实现的重播方法。当我启动模拟时,它会运行一段时间,但随后出现以下错误:

check_and_cast(): cannot cast NULL pointer to type 'IPv4ControlInfo *'
这是我的方法:

void AODVRouting::Replay (cMessage *msg)
{
        std::cout<<"Mal Host Activity"<<endl;
        EV <<"Mal Host Activity \n";
        this->bubble("Replaying...");
        this->host->setDisplayString("i=misc/node,red");

            cMessage *ReplayMsg = msg->dup();
            std::cout<<"Done Duplicating MSG"<<endl;
            EV<<"Done Duplicating MSG \n";


            //we can add a delay before sending the copy of the message again (10 time units)
            //scheduleAt(simTime() + 1, ReplayMsg);
            send(ReplayMsg, "ipOut");
            //sendDelayed(ReplayMsg, 0.01,"ipOut");

            std::cout<<"Launched Replayed Packet!\n";
            EV<<"Launched Replayed Packet!\n";
            this->bubble("Attack");
}
void AODVRouting::Replay(cMessage*msg)
{

std::cout似乎ipv4address指向一个空因子-数据包在到达我正在尝试的命令之前被销毁。 我通过引用索引而不是IP找到了修复方法,使用:
getIndex()

是否尝试调试仿真模型?一个错误导致另一个错误…我想我检查目标地址的方式不对。还不确定。