From 343cdcfeed3c5dd9403766ca07a3928a795b5e4d Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 31 Oct 2024 09:37:02 -0500 Subject: [PATCH] fix(mobile): not throwing error when cannot parse orientation value (#13853) * fix(mobile): not throw when error in parsing the orientation * fix(mobile): not throw when error in parsing the orientation * linting --- mobile/lib/entities/asset.entity.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobile/lib/entities/asset.entity.dart b/mobile/lib/entities/asset.entity.dart index 8e2d9c84d5..182c10307f 100644 --- a/mobile/lib/entities/asset.entity.dart +++ b/mobile/lib/entities/asset.entity.dart @@ -524,7 +524,8 @@ bool isRotated270CW(int orientation) { /// Returns `true` if this [Asset] is flipped 90° or 270° clockwise bool isFlipped(AssetResponseDto response) { - final int orientation = response.exifInfo?.orientation?.toInt() ?? 0; + final int orientation = + int.tryParse(response.exifInfo?.orientation ?? '0') ?? 0; return orientation != 0 && (isRotated90CW(orientation) || isRotated270CW(orientation)); }