Skip to content

Commit

Permalink
fix crash on some android 6 devices
Browse files Browse the repository at this point in the history
  • Loading branch information
bemaverick authored Aug 29, 2019
1 parent 55059a3 commit f320f5a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,18 @@ export default class PhoneInput extends Component {
onPress={this.onPressFlag}
disabled={disabled}
>
<Image
source={Flags.get(iso2)}
style={[styles.flag, this.props.flagStyle]}
onPress={this.onPressFlag}
/>
{
!!Flags.get(iso2) ? (
<Image
source={Flags.get(iso2)}
style={[styles.flag, this.props.flagStyle]}
onPress={this.onPressFlag}
/>
) :
<View
style={[styles.flag, this.props.flagStyle]}
/>
}
</TouchableWithoutFeedback>
<View style={{ flex: 1, marginLeft: this.props.offset || 10 }}>
<TextComponent
Expand Down

0 comments on commit f320f5a

Please sign in to comment.