Skip to content

Commit 6e8e316

Browse files
Fix MediaEditorScreen collage export: invalid guard-else-else
Release Swift treats `guard let … else { assign } else { … }` as a syntax error (consecutive statements). Use `if let` so a photos-only collage soft-completes instead of trapping, matching the rest of the export path. Co-authored-by: D3C0Y <decoder-dev@users.noreply.github.com>
1 parent e143399 commit 6e8e316

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎submodules/TelegramUI/Components/MediaEditorScreen/Sources/MediaEditorScreen.swift‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8414,9 +8414,7 @@ public final class MediaEditorScreenImpl: ViewController, MediaEditorScreen, UID
84148414
}
84158415
}
84168416
}
8417-
guard let (_, mainItem) = maxDurationItem else {
8418-
exportSubject = .complete()
8419-
} else {
8417+
if let (_, mainItem) = maxDurationItem {
84208418
switch mainItem.content {
84218419
case let .video(path, _):
84228420
exportSubject = .single(.video(asset: AVURLAsset(url: NSURL(fileURLWithPath: path) as URL), isStory: true))
@@ -8436,6 +8434,8 @@ public final class MediaEditorScreenImpl: ViewController, MediaEditorScreen, UID
84368434
default:
84378435
exportSubject = .complete()
84388436
}
8437+
} else {
8438+
exportSubject = .complete()
84398439
}
84408440
case let .image(image, _, _, _, _):
84418441
exportSubject = .single(.image(image: image))

0 commit comments

Comments
 (0)