diff --git a/Telegram/SourceFiles/core/file_utilities.cpp b/Telegram/SourceFiles/core/file_utilities.cpp index f54459ed6..9c9fbb308 100644 --- a/Telegram/SourceFiles/core/file_utilities.cpp +++ b/Telegram/SourceFiles/core/file_utilities.cpp @@ -195,6 +195,7 @@ QString DefaultDownloadPath(not_null session) { Core::App().saveSettings(); return result; } + return QString(); } return realDefaultPath; } diff --git a/Telegram/SourceFiles/data/data_document.cpp b/Telegram/SourceFiles/data/data_document.cpp index 8e42df919..f364bdd9e 100644 --- a/Telegram/SourceFiles/data/data_document.cpp +++ b/Telegram/SourceFiles/data/data_document.cpp @@ -155,6 +155,7 @@ QString FileNameUnsafe( return path; } }(); + if (path.isEmpty()) return QString(); if (name.isEmpty()) name = qsl(".unknown"); if (name.at(0) == QChar::fromLatin1('.')) { if (!QDir().exists(path)) QDir().mkpath(path); diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index abcb11af2..630f830e2 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -1750,6 +1750,7 @@ void OverlayWidget::downloadMedia() { } else { path = Core::App().settings().downloadPath(); } + if (path.isEmpty()) return; QString toName; if (_document) { const auto &location = _document->location(true);