Skip to content

Commit bd2d887

Browse files
author
Ravbug
committed
Fix crash when date is invalid due to missing project
1 parent 5f65691 commit bd2d887

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

source/globals.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ ParsedVersion parseVersion(const std::string_view version) {
2525

2626

2727
std::string project::modifyDateString() const {
28+
if (modifiedDate == std::numeric_limits<decltype(modifiedDate)>::min()) {
29+
return "???";
30+
}
2831
#if _WIN32
2932
long
3033
#endif

source/interface_derived.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ project MainFrameDerived::LoadProject(const std::filesystem::path &p_as_fs){
531531
}
532532

533533
//get the modification date
534-
int64_t modifyDate;
534+
int64_t modifyDate = std::numeric_limits<decltype(project::modifiedDate)>::min();
535535
struct stat fileInfo {};
536536
if (filesystem::exists(p_as_fs)) {
537537
if (stat(p_as_fs.string().c_str(), &fileInfo) == 0) {

0 commit comments

Comments
 (0)