Guard GetModificationTime with IsValid otherwise it'll return based on INT64_MIN.

Fixes KICAD-3Z0
This commit is contained in:
Marek Roszko 2023-10-01 09:42:41 -04:00
parent f1c5581802
commit bfbba632df
3 changed files with 3 additions and 3 deletions

View File

@ -4010,7 +4010,7 @@ long long SCH_ALTIUM_PLUGIN::getLibraryTimestamp( const wxString& aLibraryPath )
{ {
wxFileName fn( aLibraryPath ); wxFileName fn( aLibraryPath );
if( fn.IsFileReadable() ) if( fn.IsFileReadable() && fn.GetModificationTime().IsValid() )
return fn.GetModificationTime().GetValue().GetValue(); return fn.GetModificationTime().GetValue().GetValue();
else else
return wxDateTime( 0.0 ).GetValue().GetValue(); return wxDateTime( 0.0 ).GetValue().GetValue();

View File

@ -140,7 +140,7 @@ long long ALTIUM_DESIGNER_PLUGIN::GetLibraryTimestamp( const wxString& aLibraryP
wxFileName fn( aLibraryPath ); wxFileName fn( aLibraryPath );
if( fn.IsFileReadable() ) if( fn.IsFileReadable() && fn.GetModificationTime().IsValid() )
{ {
return fn.GetModificationTime().GetValue().GetValue(); return fn.GetModificationTime().GetValue().GetValue();
} }

View File

@ -226,7 +226,7 @@ long long CADSTAR_PCB_ARCHIVE_PLUGIN::GetLibraryTimestamp( const wxString& aLibr
{ {
wxFileName fn( aLibraryPath ); wxFileName fn( aLibraryPath );
if( fn.IsFileReadable() ) if( fn.IsFileReadable() && fn.GetModificationTime().IsValid() )
return fn.GetModificationTime().GetValue().GetValue(); return fn.GetModificationTime().GetValue().GetValue();
else else
return wxDateTime( 0.0 ).GetValue().GetValue(); return wxDateTime( 0.0 ).GetValue().GetValue();