Skip to content

fix crash on some android 6 devices, (image can't be null) #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/react-native-phone-input.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified lib/.DS_Store
Binary file not shown.
18 changes: 13 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,25 @@ export default class PhoneInput extends Component {
render() {
const { iso2, inputValue, disabled } = this.state;
const TextComponent = this.props.textComponent || TextInput;
const FlagSource = Flags.get(iso2);
return (
<View style={[styles.container, this.props.style]}>
<TouchableWithoutFeedback
onPress={this.onPressFlag}
disabled={disabled}
>
<Image
source={Flags.get(iso2)}
style={[styles.flag, this.props.flagStyle]}
onPress={this.onPressFlag}
/>
{
!!FlagSource ?(
<Image
source={FlagSource}
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
Binary file modified lib/resources/.DS_Store
Binary file not shown.
Binary file modified lib/resources/flags/.DS_Store
Binary file not shown.
Binary file added lib/resources/flags/images/.DS_Store
Binary file not shown.
Binary file removed lib/resources/flags/images/ad.png
Binary file not shown.
Binary file added lib/resources/flags/images/ad.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/ae.png
Binary file not shown.
Binary file added lib/resources/flags/images/ae.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/af.png
Binary file not shown.
Binary file added lib/resources/flags/images/af.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/ag.png
Binary file not shown.
Binary file added lib/resources/flags/images/ag.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/ai.png
Binary file not shown.
Binary file added lib/resources/flags/images/ai.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/al.png
Binary file not shown.
Binary file added lib/resources/flags/images/al.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/am.png
Binary file not shown.
Binary file added lib/resources/flags/images/am.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/ao.png
Binary file not shown.
Binary file added lib/resources/flags/images/ao.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/ar.png
Binary file not shown.
Binary file added lib/resources/flags/images/ar.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/as.png
Binary file not shown.
Binary file added lib/resources/flags/images/as.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/at.png
Binary file not shown.
Binary file added lib/resources/flags/images/at.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/au.png
Binary file not shown.
Binary file added lib/resources/flags/images/au.png.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/resources/flags/images/aw.png
Binary file not shown.
Binary file added lib/resources/flags/images/aw.png.jpg
Binary file removed lib/resources/flags/images/ax.png
Diff not rendered.
Binary file added lib/resources/flags/images/ax.png.jpg
Binary file removed lib/resources/flags/images/az.png
Diff not rendered.
Binary file added lib/resources/flags/images/az.png.jpg
Binary file removed lib/resources/flags/images/ba.png
Diff not rendered.
Binary file added lib/resources/flags/images/ba.png.jpg
Binary file removed lib/resources/flags/images/bb.png
Diff not rendered.
Binary file added lib/resources/flags/images/bb.png.jpg
Binary file removed lib/resources/flags/images/bd.png
Diff not rendered.
Binary file added lib/resources/flags/images/bd.png.jpg
Binary file removed lib/resources/flags/images/be.png
Diff not rendered.
Binary file added lib/resources/flags/images/be.png.jpg
Binary file removed lib/resources/flags/images/bf.png
Diff not rendered.
Binary file added lib/resources/flags/images/bf.png.jpg
Binary file removed lib/resources/flags/images/bg.png
Diff not rendered.
Binary file added lib/resources/flags/images/bg.png.jpg
Binary file removed lib/resources/flags/images/bh.png
Diff not rendered.
Binary file added lib/resources/flags/images/bh.png.jpg
Binary file removed lib/resources/flags/images/bi.png
Diff not rendered.
Binary file added lib/resources/flags/images/bi.png.jpg
Binary file removed lib/resources/flags/images/bj.png
Diff not rendered.
Binary file added lib/resources/flags/images/bj.png.jpg
Binary file removed lib/resources/flags/images/bl.png
Diff not rendered.
Binary file added lib/resources/flags/images/bl.png.jpg
Binary file removed lib/resources/flags/images/bm.png
Diff not rendered.
Binary file added lib/resources/flags/images/bm.png.jpg
Binary file removed lib/resources/flags/images/bn.png
Diff not rendered.
Binary file added lib/resources/flags/images/bn.png.jpg
Binary file removed lib/resources/flags/images/bo.png
Diff not rendered.
Binary file added lib/resources/flags/images/bo.png.jpg
Binary file removed lib/resources/flags/images/bq.png
Diff not rendered.
Binary file added lib/resources/flags/images/bq.png.jpg
Binary file removed lib/resources/flags/images/br.png
Diff not rendered.
Binary file added lib/resources/flags/images/br.png.jpg
Binary file removed lib/resources/flags/images/bs.png
Diff not rendered.
Binary file added lib/resources/flags/images/bs.png.jpg
Binary file removed lib/resources/flags/images/bt.png
Diff not rendered.
Binary file added lib/resources/flags/images/bt.png.jpg
Binary file removed lib/resources/flags/images/bw.png
Diff not rendered.
Binary file added lib/resources/flags/images/bw.png.jpg
Binary file removed lib/resources/flags/images/by.png
Diff not rendered.
Binary file added lib/resources/flags/images/by.png.jpg
Binary file removed lib/resources/flags/images/bz.png
Diff not rendered.
Binary file added lib/resources/flags/images/bz.png.jpg
Binary file removed lib/resources/flags/images/ca.png
Diff not rendered.
Binary file added lib/resources/flags/images/ca.png.jpg
Binary file removed lib/resources/flags/images/cc.png
Diff not rendered.
Binary file added lib/resources/flags/images/cc.png.jpg
Binary file removed lib/resources/flags/images/cd.png
Diff not rendered.
Binary file added lib/resources/flags/images/cd.png.jpg
Binary file removed lib/resources/flags/images/cf.png
Diff not rendered.
Binary file added lib/resources/flags/images/cf.png.jpg
Binary file removed lib/resources/flags/images/cg.png
Diff not rendered.
Binary file added lib/resources/flags/images/cg.png.jpg
Binary file removed lib/resources/flags/images/ch.png
Diff not rendered.
Binary file added lib/resources/flags/images/ch.png.jpg
Binary file removed lib/resources/flags/images/ci.png
Diff not rendered.
Binary file added lib/resources/flags/images/ci.png.jpg
Binary file removed lib/resources/flags/images/ck.png
Diff not rendered.
Binary file added lib/resources/flags/images/ck.png.jpg
Binary file removed lib/resources/flags/images/cl.png
Diff not rendered.
Binary file added lib/resources/flags/images/cl.png.jpg
Binary file removed lib/resources/flags/images/cm.png
Diff not rendered.
Binary file added lib/resources/flags/images/cm.png.jpg
Binary file removed lib/resources/flags/images/cn.png
Diff not rendered.
Binary file added lib/resources/flags/images/cn.png.jpg
Binary file removed lib/resources/flags/images/co.png
Diff not rendered.
Binary file added lib/resources/flags/images/co.png.jpg
Binary file removed lib/resources/flags/images/cr.png
Diff not rendered.
Binary file added lib/resources/flags/images/cr.png.jpg
Binary file removed lib/resources/flags/images/cu.png
Diff not rendered.
Binary file added lib/resources/flags/images/cu.png.jpg
Binary file removed lib/resources/flags/images/cv.png
Diff not rendered.
Binary file added lib/resources/flags/images/cv.png.jpg
Binary file removed lib/resources/flags/images/cw.png
Diff not rendered.
Binary file added lib/resources/flags/images/cw.png.jpg
Binary file removed lib/resources/flags/images/cx.png
Diff not rendered.
Binary file added lib/resources/flags/images/cx.png.jpg
Binary file removed lib/resources/flags/images/cy.png
Diff not rendered.
Binary file added lib/resources/flags/images/cy.png.jpg
Binary file removed lib/resources/flags/images/cz.png
Diff not rendered.
Binary file added lib/resources/flags/images/cz.png.jpg
Binary file removed lib/resources/flags/images/de.png
Diff not rendered.
Binary file added lib/resources/flags/images/de.png.jpg
Binary file removed lib/resources/flags/images/dj.png
Diff not rendered.
Binary file added lib/resources/flags/images/dj.png.jpg
Binary file removed lib/resources/flags/images/dk.png
Diff not rendered.
Binary file added lib/resources/flags/images/dk.png.jpg
Binary file removed lib/resources/flags/images/dm.png
Diff not rendered.
Binary file added lib/resources/flags/images/dm.png.jpg
Binary file removed lib/resources/flags/images/do.png
Diff not rendered.
Binary file added lib/resources/flags/images/do.png.jpg
Binary file removed lib/resources/flags/images/dz.png
Diff not rendered.
Binary file added lib/resources/flags/images/dz.png.jpg
Binary file removed lib/resources/flags/images/ec.png
Diff not rendered.
Binary file added lib/resources/flags/images/ec.png.jpg
Binary file removed lib/resources/flags/images/ee.png
Diff not rendered.
Binary file added lib/resources/flags/images/ee.png.jpg
Binary file removed lib/resources/flags/images/eg.png
Diff not rendered.
Binary file added lib/resources/flags/images/eg.png.jpg
Binary file removed lib/resources/flags/images/eh.png
Diff not rendered.
Binary file added lib/resources/flags/images/eh.png.jpg
Binary file removed lib/resources/flags/images/er.png
Diff not rendered.
Binary file added lib/resources/flags/images/er.png.jpg
Binary file removed lib/resources/flags/images/es.png
Diff not rendered.
Binary file added lib/resources/flags/images/es.png.jpg
Binary file removed lib/resources/flags/images/et.png
Diff not rendered.
Binary file added lib/resources/flags/images/et.png.jpg
Binary file removed lib/resources/flags/images/fi.png
Diff not rendered.
Binary file added lib/resources/flags/images/fi.png.jpg
Binary file removed lib/resources/flags/images/fj.png
Diff not rendered.
Binary file added lib/resources/flags/images/fj.png.jpg
Binary file removed lib/resources/flags/images/fk.png
Diff not rendered.
Binary file added lib/resources/flags/images/fk.png.jpg
Binary file removed lib/resources/flags/images/fm.png
Diff not rendered.
Binary file added lib/resources/flags/images/fm.png.jpg
Binary file removed lib/resources/flags/images/fo.png
Diff not rendered.
Binary file added lib/resources/flags/images/fo.png.jpg
Binary file removed lib/resources/flags/images/fr.png
Diff not rendered.
Binary file added lib/resources/flags/images/fr.png.jpg
Binary file removed lib/resources/flags/images/ga.png
Diff not rendered.
Binary file added lib/resources/flags/images/ga.png.jpg
Binary file removed lib/resources/flags/images/gb.png
Diff not rendered.
Binary file added lib/resources/flags/images/gb.png.jpg
Binary file removed lib/resources/flags/images/gd.png
Diff not rendered.
Binary file added lib/resources/flags/images/gd.png.jpg
Binary file removed lib/resources/flags/images/ge.png
Diff not rendered.
Binary file added lib/resources/flags/images/ge.png.jpg
Binary file removed lib/resources/flags/images/gf.png
Diff not rendered.
Binary file added lib/resources/flags/images/gf.png.jpg
Binary file removed lib/resources/flags/images/gg.png
Diff not rendered.
Binary file added lib/resources/flags/images/gg.png.jpg
Binary file removed lib/resources/flags/images/gh.png
Diff not rendered.
Binary file added lib/resources/flags/images/gh.png.jpg
Binary file removed lib/resources/flags/images/gi.png
Diff not rendered.
Binary file added lib/resources/flags/images/gi.png.jpg
Binary file removed lib/resources/flags/images/gm.png
Diff not rendered.
Binary file added lib/resources/flags/images/gm.png.jpg
Binary file removed lib/resources/flags/images/gn.png
Diff not rendered.
Binary file added lib/resources/flags/images/gn.png.jpg
Binary file removed lib/resources/flags/images/gp.png
Diff not rendered.
Binary file added lib/resources/flags/images/gp.png.jpg
Binary file removed lib/resources/flags/images/gq.png
Diff not rendered.
Binary file added lib/resources/flags/images/gq.png.jpg
Binary file removed lib/resources/flags/images/gr.png
Diff not rendered.
Binary file added lib/resources/flags/images/gr.png.jpg
Binary file removed lib/resources/flags/images/gt.png
Diff not rendered.
Binary file added lib/resources/flags/images/gt.png.jpg
Binary file removed lib/resources/flags/images/gu.png
Diff not rendered.
Binary file added lib/resources/flags/images/gu.png.jpg
Binary file removed lib/resources/flags/images/gw.png
Diff not rendered.
Binary file added lib/resources/flags/images/gw.png.jpg
Binary file removed lib/resources/flags/images/gy.png
Diff not rendered.
Binary file added lib/resources/flags/images/gy.png.jpg
Binary file removed lib/resources/flags/images/hk.png
Diff not rendered.
Binary file added lib/resources/flags/images/hk.png.jpg
Binary file removed lib/resources/flags/images/hn.png
Diff not rendered.
Binary file added lib/resources/flags/images/hn.png.jpg
Binary file removed lib/resources/flags/images/hr.png
Diff not rendered.
Binary file added lib/resources/flags/images/hr.png.jpg
Binary file removed lib/resources/flags/images/ht.png
Diff not rendered.
Binary file added lib/resources/flags/images/ht.png.jpg
Binary file removed lib/resources/flags/images/hu.png
Diff not rendered.
Binary file added lib/resources/flags/images/hu.png.jpg
Binary file removed lib/resources/flags/images/id.png
Diff not rendered.
Binary file added lib/resources/flags/images/id.png.jpg
Binary file removed lib/resources/flags/images/ie.png
Diff not rendered.
Binary file added lib/resources/flags/images/ie.png.jpg
Binary file removed lib/resources/flags/images/il.png
Diff not rendered.
Binary file added lib/resources/flags/images/il.png.jpg
Binary file removed lib/resources/flags/images/im.png
Diff not rendered.
Binary file added lib/resources/flags/images/im.png.jpg
Binary file removed lib/resources/flags/images/in.png
Diff not rendered.
Binary file added lib/resources/flags/images/in.png.jpg
Binary file removed lib/resources/flags/images/io.png
Diff not rendered.
Binary file added lib/resources/flags/images/io.png.jpg
Binary file removed lib/resources/flags/images/iq.png
Diff not rendered.
Binary file added lib/resources/flags/images/iq.png.jpg
Binary file removed lib/resources/flags/images/ir.png
Diff not rendered.
Binary file added lib/resources/flags/images/ir.png.jpg
Binary file removed lib/resources/flags/images/is.png
Diff not rendered.
Binary file added lib/resources/flags/images/is.png.jpg
Binary file removed lib/resources/flags/images/it.png
Diff not rendered.
Binary file added lib/resources/flags/images/it.png.jpg
Binary file removed lib/resources/flags/images/je.png
Diff not rendered.
Binary file added lib/resources/flags/images/je.png.jpg
Binary file removed lib/resources/flags/images/jm.png
Diff not rendered.
Binary file added lib/resources/flags/images/jm.png.jpg
Binary file removed lib/resources/flags/images/jo.png
Diff not rendered.
Binary file added lib/resources/flags/images/jo.png.jpg
Binary file removed lib/resources/flags/images/jp.png
Diff not rendered.
Binary file added lib/resources/flags/images/jp.png.jpg
Binary file removed lib/resources/flags/images/ke.png
Diff not rendered.
Binary file added lib/resources/flags/images/ke.png.jpg
Binary file removed lib/resources/flags/images/kg.png
Diff not rendered.
Binary file added lib/resources/flags/images/kg.png.jpg
Binary file removed lib/resources/flags/images/kh.png
Diff not rendered.
Binary file added lib/resources/flags/images/kh.png.jpg
Binary file removed lib/resources/flags/images/ki.png
Diff not rendered.
Binary file added lib/resources/flags/images/ki.png.jpg
Binary file removed lib/resources/flags/images/km.png
Diff not rendered.
Binary file added lib/resources/flags/images/km.png.jpg
Binary file removed lib/resources/flags/images/kn.png
Diff not rendered.
Binary file added lib/resources/flags/images/kn.png.jpg
Binary file removed lib/resources/flags/images/kp.png
Diff not rendered.
Binary file added lib/resources/flags/images/kp.png.jpg
Binary file removed lib/resources/flags/images/kr.png
Diff not rendered.
Binary file added lib/resources/flags/images/kr.png.jpg
Binary file removed lib/resources/flags/images/ks.png
Diff not rendered.
Binary file added lib/resources/flags/images/ks.png.jpg
Binary file removed lib/resources/flags/images/kw.png
Diff not rendered.
Binary file added lib/resources/flags/images/kw.png.jpg
Binary file removed lib/resources/flags/images/ky.png
Diff not rendered.
Binary file added lib/resources/flags/images/ky.png.jpg
Binary file removed lib/resources/flags/images/kz.png
Diff not rendered.
Binary file added lib/resources/flags/images/kz.png.jpg
Binary file removed lib/resources/flags/images/la.png
Diff not rendered.
Binary file added lib/resources/flags/images/la.png.jpg
Binary file removed lib/resources/flags/images/lb.png
Diff not rendered.
Binary file added lib/resources/flags/images/lb.png.jpg
Binary file removed lib/resources/flags/images/lc.png
Diff not rendered.
Binary file added lib/resources/flags/images/lc.png.jpg
Binary file removed lib/resources/flags/images/li.png
Diff not rendered.
Binary file added lib/resources/flags/images/li.png.jpg
Binary file removed lib/resources/flags/images/lk.png
Diff not rendered.
Binary file added lib/resources/flags/images/lk.png.jpg
Binary file removed lib/resources/flags/images/lr.png
Diff not rendered.
Binary file added lib/resources/flags/images/lr.png.jpg
Binary file removed lib/resources/flags/images/ls.png
Diff not rendered.
Binary file added lib/resources/flags/images/ls.png.jpg
Binary file removed lib/resources/flags/images/lt.png
Diff not rendered.
Binary file added lib/resources/flags/images/lt.png.jpg
Binary file removed lib/resources/flags/images/lu.png
Diff not rendered.
Binary file added lib/resources/flags/images/lu.png.jpg
Binary file removed lib/resources/flags/images/lv.png
Diff not rendered.
Binary file added lib/resources/flags/images/lv.png.jpg
Binary file removed lib/resources/flags/images/ly.png
Diff not rendered.
Binary file added lib/resources/flags/images/ly.png.jpg
Binary file removed lib/resources/flags/images/ma.png
Diff not rendered.
Binary file added lib/resources/flags/images/ma.png.jpg
Binary file removed lib/resources/flags/images/mc.png
Diff not rendered.
Binary file added lib/resources/flags/images/mc.png.jpg
Binary file removed lib/resources/flags/images/md.png
Diff not rendered.
Binary file added lib/resources/flags/images/md.png.jpg
Binary file removed lib/resources/flags/images/me.png
Diff not rendered.
Binary file added lib/resources/flags/images/me.png.jpg
Binary file removed lib/resources/flags/images/mf.png
Diff not rendered.
Binary file added lib/resources/flags/images/mf.png.jpg
Binary file removed lib/resources/flags/images/mg.png
Diff not rendered.
Binary file added lib/resources/flags/images/mg.png.jpg
Binary file removed lib/resources/flags/images/mh.png
Diff not rendered.
Binary file added lib/resources/flags/images/mh.png.jpg
Binary file removed lib/resources/flags/images/mk.png
Diff not rendered.
Binary file added lib/resources/flags/images/mk.png.jpg
Binary file removed lib/resources/flags/images/ml.png
Diff not rendered.
Binary file added lib/resources/flags/images/ml.png.jpg
Binary file removed lib/resources/flags/images/mm.png
Diff not rendered.
Binary file added lib/resources/flags/images/mm.png.jpg
Binary file removed lib/resources/flags/images/mn.png
Diff not rendered.
Binary file added lib/resources/flags/images/mn.png.jpg
Binary file removed lib/resources/flags/images/mo.png
Diff not rendered.
Binary file added lib/resources/flags/images/mo.png.jpg
Binary file removed lib/resources/flags/images/mp.png
Diff not rendered.
Loading