Skip to content

Commit

Permalink
[FIX] AttachmentView crashing during title decode (#2253)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Mello <[email protected]>
  • Loading branch information
djorkaeffalexandre and diegolmello committed Jul 8, 2020
1 parent 0583de7 commit db0520e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/views/AttachmentView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => <CloseModalButton testID='close-attachment-view' navigation={navigation} buttonStyle={{ color: themes[theme].previewTintColor }} />,
title: decodeURI(title),
headerRight: () => <SaveButton testID='save-image' onPress={this.handleSave} buttonStyle={{ color: themes[theme].previewTintColor }} />,
headerBackground: () => <View style={{ flex: 1, backgroundColor: themes[theme].previewBackground }} />,
headerTintColor: themes[theme].previewTintColor,
Expand Down

0 comments on commit db0520e

Please sign in to comment.