NathanaelA / nativescript-permissions

Wraps up the entire Android 6 permissions system in a easy to use plugin.
MIT License
46 stars 22 forks source link

Fix: Crash when permission is requested by other plugin #19

Closed vakrilov closed 7 years ago

vakrilov commented 7 years ago

When another plugin(or user code) requests a permission - the activityRequestPermissionsEvent event is fired. However, because the permission was not requested by the nativescript-permissions plugin there is no track of the request inside the pendingPromises. This code change prevents the the Cannot call property "granted" of undefined" in that case.

NathanaelA commented 7 years ago

Good catch @vakrilov , thanks for the pull request.

NathanaelA commented 7 years ago

v1.2.1 with patch has been published on npm.