-
Notifications
You must be signed in to change notification settings - Fork 267
Cannot read property 'native' of null. Warnings and errors. #56
Comments
Hi. |
Hello again! |
This shouldn't stop you in anyway, we will have a look into it, but it should not affect the operation of the plugin. |
Is there any other information I can provide to help fix this problem? |
@Darkoon If you could provide the name and value of the failing entry it could point us to the right direction. If this is a problem for you I could instruct you on how to do it. Thanks. |
I don't quiet understand about what entry are you talking (warnings/errors pop up for every key-value pair even for 'mykey', 'myvalue' from readme examples). So if you are talking about something else, please instruct me. |
I am talking about debugging the plugin code. The error happens while migrating old data as ggozad already mentioned. Adding a printout of the key value pair that is being migrated in line 362 of securestorage.js would do the job. You can do the change either by forking this project or by changing the downloaded plugin code. |
Sorry for the late response! Log added in line 362 was never called, so I decided to log key and value from line 385. I saw pairs generating warnings/errors, keys: |
Line 387 in www/securestorage.js does not check for a null value returned from JSON.parse and thus throws and exception. I modified that line to read: if (payload != null && !payload.native) { and it fixed the problem for me. |
@jmotyl1959 Hey, thanks but you solve the problem by hiding the reason. Can you confirm Darkoon's findings? |
@Darkoon @jmotyl1959 Can you please verify that applying the correction I did in my PR fixes the problem? My tests show it does but I 'll wait until you verify. Thanks for the help. |
@demetris-manikas I can confirm that your correction fixed the problem for me. |
Fixed in 2.5.2 |
Hello!
I wanted to try out this plugin in my angularJS cordova application. I wrapped plugin methods in simple service and used it in simple cases of setting/getting string value. Everything works fine but console logs a few warnings:
Error in Success callbackId: SecureStorage1208879459 : TypeError: Cannot read property 'native' of null
in cordova.js:312
Also after this, few errors pop:
TypeError: Cannot read property 'native' of null
in securestorage.js:387.All functionality works fine but I want to get rid of this errors and warning. How can I do that?
Currently I'm working on cordova 6.20 and testing app on Android 5.0.2
The text was updated successfully, but these errors were encountered: