You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by agamemnus <gi...@git.apache.org> on 2014/10/09 08:34:58 UTC

[GitHub] cordova-android pull request: Fix potential null pointer error iss...

GitHub user agamemnus opened a pull request:

    https://github.com/apache/cordova-android/pull/126

    Fix potential null pointer error issue.

    I am writing a Google Play APK expansion library.
    
    All the libraries I have seen so far store version data inside the content provider's tag as meta-data, and again inside a separate .xml file. This is wrong, but they are forced to do this because it is very difficult to figure out the code to source all data from one xml file. I have done this, but it does require telling Cordova not to extract the zip file before the plugin file is ready.
    
    To do that, I return a null value from APEZProvider (extends ContentProvider for APKs) if the APK expansion plugin class instance didn't run yet. That of course causes Cordova to crash because it doesn't have the null test I am proposing.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/agamemnus/cordova-android patch-1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-android/pull/126.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #126
    
----
commit efb59884123cbf377de7746bf269ab741f86bbbe
Author: agamemnus <ag...@gmail.com>
Date:   2014-10-09T06:34:49Z

    Fix potential null pointer error issue.
    
    I am writing a Google Play APK expansion library.
    
    All the libraries I have seen so far store version data inside the content provider's tag as meta-data, and again inside a separate .xml file. This is wrong, but they are forced to do this because it is very difficult to figure out the code to source all data from one xml file. I have done this, but it does require telling Cordova not to extract the zip file before the plugin file is ready.
    
    To do that, I return a null value from APEZProvider (extends ContentProvider for APKs) if the APK expansion plugin class instance didn't run yet. That of course causes Cordova to crash because it doesn't have the null test I am proposing.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android pull request: Fix potential null pointer error iss...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-android/pull/126


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android pull request: Fix potential null pointer error iss...

Posted by agrieve <gi...@git.apache.org>.
Github user agrieve commented on the pull request:

    https://github.com/apache/cordova-android/pull/126#issuecomment-66558156
  
    Have a read of the last line of the javadoc. The function should either return a new object, or throw a FileNotFound exception (never returns null)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android pull request: Fix potential null pointer error iss...

Posted by agamemnus <gi...@git.apache.org>.
Github user agamemnus commented on the pull request:

    https://github.com/apache/cordova-android/pull/126#issuecomment-58514514
  
    Doesn't a FileNotFoundException end the program? (sorry, not sure...) The idea is to prevent that and let everything run normally.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-android pull request: Fix potential null pointer error iss...

Posted by agrieve <gi...@git.apache.org>.
Github user agrieve commented on the pull request:

    https://github.com/apache/cordova-android/pull/126#issuecomment-58511873
  
    From the [JavaDoc](http://developer.android.com/reference/android/content/ContentResolver.html#openAssetFileDescriptor(android.net.Uri, java.lang.String, android.os.CancellationSignal)) for openAssetFileDescriptor, I think you should be throwing a FileNotFoundException rather than returning null.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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