Browse Source

Bugfix: will not try to remove sessions that no longer exist

Tal Aloni 8 years ago
parent
commit
d17ad94c7b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      ISCSI/ISCSI.Server/SessionManager.cs

+ 4 - 1
ISCSI/ISCSI.Server/SessionManager.cs

@@ -46,7 +46,10 @@ namespace ISCSI.Server
             lock (m_activeSessions)
             {
                 int index = GetSessionIndex(session.ISID);
-                m_activeSessions.RemoveAt(index);
+                if (index >= 0)
+                {
+                    m_activeSessions.RemoveAt(index);
+                }
             }
         }