core: null check project autorecovery

This commit is contained in:
itsmattkc
2023-03-01 20:14:25 -08:00
parent 066a10e6a0
commit d32849f4fb
+1 -1
View File
@@ -954,7 +954,7 @@ void Core::SaveRecentProjectsList()
void Core::SaveAutorecovery() void Core::SaveAutorecovery()
{ {
if (OLIVE_CONFIG("AutorecoveryEnabled").toBool()) { if (OLIVE_CONFIG("AutorecoveryEnabled").toBool()) {
if (!open_project_->has_autorecovery_been_saved()) { if (open_project_ && !open_project_->has_autorecovery_been_saved()) {
QDir project_autorecovery_dir(QDir(FileFunctions::GetAutoRecoveryRoot()).filePath(open_project_->GetUuid().toString())); QDir project_autorecovery_dir(QDir(FileFunctions::GetAutoRecoveryRoot()).filePath(open_project_->GetUuid().toString()));
if (FileFunctions::DirectoryIsValid(project_autorecovery_dir)) { if (FileFunctions::DirectoryIsValid(project_autorecovery_dir)) {
QString this_autorecovery_path = project_autorecovery_dir.filePath(QStringLiteral("%1.ove").arg(QString::number(QDateTime::currentSecsSinceEpoch()))); QString this_autorecovery_path = project_autorecovery_dir.filePath(QStringLiteral("%1.ove").arg(QString::number(QDateTime::currentSecsSinceEpoch())));