Procházet zdrojové kódy

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

Tal Aloni před 8 roky
rodič
revize
d17ad94c7b
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  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);
+                }
             }
         }