From 66a5e67cbfac353c475e1bbb3797d3a590dfa28d Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 4 Mar 2026 11:08:19 +0300 Subject: [PATCH] Fixed losing of extension when rename image from clipboard. --- Telegram/SourceFiles/boxes/send_files_box.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Telegram/SourceFiles/boxes/send_files_box.cpp b/Telegram/SourceFiles/boxes/send_files_box.cpp index 487a33007b..58ed48001e 100644 --- a/Telegram/SourceFiles/boxes/send_files_box.cpp +++ b/Telegram/SourceFiles/boxes/send_files_box.cpp @@ -128,6 +128,9 @@ void RenameFileBox( rpl::single(QString()), currentName)); const auto extension = [&] { + if (currentName.isEmpty()) { + return u".png"_q; + } const auto dot = currentName.lastIndexOf('.'); return (dot >= 0) ? currentName.mid(dot) : QString(); }();