瀏覽代碼

Merge pull request #6 from willowrose/dev1

Prevent Access Violation when FNetClients not assigned
Pascal Coin 9 年之前
父節點
當前提交
63ee0dedd7
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Units/PascalCoin/UNetProtocol.pas

+ 5 - 0
Units/PascalCoin/UNetProtocol.pas

@@ -1223,6 +1223,11 @@ var i : Integer;
 begin
   inherited;
   if (Operation=opRemove) then begin
+    if not Assigned(FNetClients) then // this happens occassionally
+    begin
+      TLog.NewLog(ltdebug,ClassName,'NetServer opRemove notification when NetClients=nil');
+      exit;
+    end;
     i := FNetClients.IndexOf(AComponent);
     if (i>=0) then begin
       FNetClients.Delete(i);