From 3df2d3cad5c7a65eee469264165b6066cd6e5694 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 1 Jun 2023 16:14:03 +0400 Subject: [PATCH] Fix crash --- .../Components/MediaEditor/Sources/MediaEditorValues.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramUI/Components/MediaEditor/Sources/MediaEditorValues.swift b/submodules/TelegramUI/Components/MediaEditor/Sources/MediaEditorValues.swift index 5d35c31d72..18d603c35e 100644 --- a/submodules/TelegramUI/Components/MediaEditor/Sources/MediaEditorValues.swift +++ b/submodules/TelegramUI/Components/MediaEditor/Sources/MediaEditorValues.swift @@ -126,7 +126,7 @@ public final class MediaEditorValues: Codable { self.videoTrimRange = try container.decodeIfPresent(Range.self, forKey: .videoTrimRange) self.videoIsMuted = try container.decode(Bool.self, forKey: .videoIsMuted) - self.videoIsFullHd = try container.decode(Bool.self, forKey: .videoIsFullHd) + self.videoIsFullHd = try container.decodeIfPresent(Bool.self, forKey: .videoIsFullHd) ?? false if let drawingData = try container.decodeIfPresent(Data.self, forKey: .drawing), let image = UIImage(data: drawingData) { self.drawing = image @@ -163,6 +163,7 @@ public final class MediaEditorValues: Codable { try container.encodeIfPresent(self.videoTrimRange, forKey: .videoTrimRange) try container.encode(self.videoIsMuted, forKey: .videoIsMuted) + try container.encode(self.videoIsFullHd, forKey: .videoIsFullHd) if let drawing = self.drawing, let pngDrawingData = drawing.pngData() { try container.encode(pngDrawingData, forKey: .drawing)