Browse Source

Prevent Access Violation when FNetClients not assigned

willowrose 9 years ago
parent
commit
69766b1ebf
1 changed files with 5 additions and 0 deletions
  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);