Просмотр исходного кода

Prevent Access Violation when FNetClients not assigned

willowrose 9 лет назад
Родитель
Сommit
69766b1ebf
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);