Fix "route remove" by guarding against constant NameError/backtrace

git-svn-id: file:///home/svn/framework3/trunk@6330 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
kris 2009-03-10 16:47:53 +00:00
parent b12a3d993e
commit b1edecb728
1 changed files with 6 additions and 3 deletions

View File

@ -690,9 +690,12 @@ class Core
# Satisfy case problems
args[2] = "Local" if (args[2] =~ /local/i)
# If the supplied gateway is a global Comm, use it.
if (Rex::Socket::Comm.const_defined?(args[2]))
gw = Rex::Socket::Comm.const_get(args[2])
begin
# If the supplied gateway is a global Comm, use it.
if (Rex::Socket::Comm.const_defined?(args[2]))
gw = Rex::Socket::Comm.const_get(args[2])
end
rescue NameError
end
# If we still don't have a gateway, check if it's a session.