From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: alina sireneva <alina@tei.su>
Date: Fri, 17 Jul 2026 00:26:09 +0400
Subject: fix crash when video cover frame fails to decode

---
 .../main/java/org/telegram/ui/Components/EditCoverButton.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditCoverButton.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditCoverButton.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditCoverButton.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditCoverButton.java
@@ -96,6 +96,10 @@ public class EditCoverButton extends View {
 
         Utilities.globalQueue.postRunnable(() -> {
             final Bitmap frame = BitmapFactory.decodeFile(path);
+            if (frame == null) {
+                AndroidUtilities.runOnUIThread(() -> setImage((Bitmap) null));
+                return;
+            }
             final Bitmap bitmap = Bitmap.createBitmap(dp(26), dp(26), Bitmap.Config.ARGB_8888);
             final Canvas canvas = new Canvas(bitmap);
             final Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG);
