summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/postcommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree/postcommand.cpp')
-rw-r--r--src/modules/m_spanningtree/postcommand.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/postcommand.cpp b/src/modules/m_spanningtree/postcommand.cpp
index 0988fe099..d2cea154a 100644
--- a/src/modules/m_spanningtree/postcommand.cpp
+++ b/src/modules/m_spanningtree/postcommand.cpp
@@ -54,7 +54,14 @@ void ModuleSpanningTree::OnPostCommand(const std::string &command, const std::ve
}
else if (routing.type == ROUTE_TYPE_OPT_UCAST)
{
- params.push_back(routing.serverdest);
+ TreeServer* sdest = Utils->FindServer(routing.serverdest);
+ if (!sdest)
+ {
+ ServerInstance->Logs->Log("m_spanningtree",ERROR,"Trying to route ENCAP to nonexistant server %s",
+ routing.serverdest.c_str());
+ return;
+ }
+ params.push_back(sdest->GetID());
params.push_back(command);
sent_cmd = "ENCAP";
}