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

FIX: WfxPlugins - don't copy invalid time

Alexander Koblov 3 лет назад
Родитель
Сommit
9c517fc282
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      src/filesources/wfxplugin/uwfxpluginutil.pas

+ 4 - 1
src/filesources/wfxplugin/uwfxpluginutil.pas

@@ -499,7 +499,10 @@ begin
   if caoCopyTime in FCopyAttributesOptions then
   if caoCopyTime in FCopyAttributesOptions then
   begin
   begin
     if (FMode = wpohmCopyOut) then
     if (FMode = wpohmCopyOut) then
-      mbFileSetTime(TargetFileName, DateTimeToFileTime(SourceFile.ModificationTime))
+    begin
+      if SourceFile.ModificationTimeProperty.IsValid then
+        mbFileSetTime(TargetFileName, DateTimeToFileTime(SourceFile.ModificationTime));
+    end
     else begin
     else begin
       WfxFileTime := DateTimeToWfxFileTime(SourceFile.ModificationTime);
       WfxFileTime := DateTimeToWfxFileTime(SourceFile.ModificationTime);
       FWfxPluginFileSource.WfxModule.WfxSetTime(TargetFileName, nil, nil, @WfxFileTime);
       FWfxPluginFileSource.WfxModule.WfxSetTime(TargetFileName, nil, nil, @WfxFileTime);