apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 210 forks source link

Null check on nv variable in storeValueByKey() #54

Closed fiveironfrnzy08 closed 8 years ago

fiveironfrnzy08 commented 8 years ago

The line nv.getClass().getName() (now line 252) has the vulnerability of throwing a NullPointerException. The line to create the JSONTokener and get the nextValue() has been wrapped in a try/catch and the resulting variable, nv, is null checked and handled with a graceful callback error.

The issue can be replicated and tested by passing null into the JSONTokener constructor on line 230 of master branch, or 233 of patch branch.