Procházet zdrojové kódy

* Fix bug ID #35674, do not create filestream for directories

git-svn-id: trunk@42174 -
michael před 6 roky
rodič
revize
109abf3d99
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  1. 3 2
      packages/paszlib/src/zipper.pp

+ 3 - 2
packages/paszlib/src/zipper.pp

@@ -2147,7 +2147,7 @@ Begin
   If Assigned(FOnCreateStream) then
     FOnCreateStream(Self, OutStream, Item);
   // If FOnCreateStream didn't create one, we create one now.
-  If (OutStream=Nil) then
+  If (OutStream=Nil) and (not Item.IsDirectory) then
     begin
     if (Path<>'') then
       ForceDirectories(Path);
@@ -2173,7 +2173,8 @@ Begin
     OutStream := nil;
   end
   else
-    FreeAndNil(OutStream);
+    if Assigned(OutStream) then
+      FreeAndNil(OutStream);
   DoEndOfFile;
 end;