From 5b3be4ef0b5ef51b9d1ad463a0a7008b177996d0 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Wed, 8 Jul 2020 13:40:51 -0300 Subject: [PATCH] [FIX] AttachmentView crashing during title decode (#2253) Co-authored-by: Diego Mello --- app/views/AttachmentView.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/AttachmentView.js b/app/views/AttachmentView.js index a4b110c72..6f43823da 100644 --- a/app/views/AttachmentView.js +++ b/app/views/AttachmentView.js @@ -70,10 +70,15 @@ class AttachmentView extends React.Component { setHeader = () => { const { route, navigation, theme } = this.props; const attachment = route.params?.attachment; - const { title } = attachment; + let { title } = attachment; + try { + title = decodeURI(title); + } catch { + // Do nothing + } const options = { + title, headerLeft: () => , - title: decodeURI(title), headerRight: () => , headerBackground: () => , headerTintColor: themes[theme].previewTintColor,