diff --git a/lib/msf/core/session_manager.rb b/lib/msf/core/session_manager.rb index 13d835e545..dc5046855f 100644 --- a/lib/msf/core/session_manager.rb +++ b/lib/msf/core/session_manager.rb @@ -279,14 +279,17 @@ class SessionManager < Hash # Returns the session associated with the supplied sid, if any. # def get(sid) + session = nil sid = sid.to_i + if sid > 0 - return self[sid] + session = self[sid] elsif sid == -1 sid = self.keys.sort[-1] - return self[sid] + session = self[sid] end - return nil + + return session end #