Github user riknoll commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/174#discussion_r57762270
  
    --- Diff: src/android/FileUtils.java ---
    @@ -1151,51 +1140,55 @@ private long truncateFile(String srcURLstr, long 
size) throws FileNotFoundExcept
     
         public void onRequestPermissionResult(int requestCode, String[] 
permissions,
                                               int[] grantResults) throws 
JSONException {
    -        for(int r:grantResults)
    -        {
    -            if(r == PackageManager.PERMISSION_DENIED)
    +
    +        final PendingRequests.Request req = 
pendingRequests.getAndRemove(requestCode);
    +        if (req != null) {
    +            for(int r:grantResults)
                 {
    -                callback.sendPluginResult(new 
PluginResult(PluginResult.Status.ERROR, SECURITY_ERR));
    +                if(r == PackageManager.PERMISSION_DENIED)
    +                {
    +                    req.getCallbackContext().sendPluginResult(new 
PluginResult(PluginResult.Status.ERROR, SECURITY_ERR));
    --- End diff --
    
    Ha, yep! Good catch! It doesn't look like there was a return there before 
either so I wonder how that worked.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to