Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

Catch exceptions when creating constants for sd card directories #619

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Catch exceptions when creating constants for sd card directories #619

wants to merge 1 commit into from

Conversation

chrusart
Copy link

@chrusart chrusart commented Dec 5, 2017

Setting SDCardApplicationDir constant throws sometimes NullPointerException.

Additionally SDCardDir and SDCardApplicationDir are set once on module load, but external storage can be ejected, unmounted and paths could be not valid anymore later.

This PR:

  1. catches NullPointerException (and other exceptions) and sets then empty path (other ideas how to handle exception are welcome) which should be handled in JS then.
  2. introduces getSDCardDir and getSDCardApplicationDir methods to get this paths when needed from JS.
  3. adds deprecation warning when constants are used.

QUESTION TO MAINTAINERS:
I've read contributing guidelines just now when was about to create PR, should I split it to separate PRs, to bug fix and feature branches. Somehow all this PR changes could or should be merged together maybe. And this is all about Android only and not sure to do all this library testing and use dev repository.

…o get sd card directories. sd card directiories as constants deprecated warning
@sivakumar-cf
Copy link

Please merge this PR. Our production app breaking this, needed asap.

@chrusart
Copy link
Author

chrusart commented Dec 8, 2017

There is a 'RNFB MAINTAINER GONE MISSING' notice, it can take some time to merge.
Feel free to use the branch for now.

@bdipak
Copy link

bdipak commented Dec 29, 2017

@chrusart any idea how much time it will take ? Looking forward to have this change released to npm.

@chrusart
Copy link
Author

chrusart commented Jan 4, 2018

No idea, I'm not related to maintainers.

@chrusart
Copy link
Author

We use our branch in production now, we don't get this crashes anymore and also some iOS crashes fixed:
"react-native-fetch-blob": "github:flatfox-ag/react-native-fetch-blob#e46f94e2ce7f135f3e9088c95bbd53cd79481ab5",

@lll000111
Copy link
Contributor

FYI

react-native-fetch-blob has a new maintained location. Check out the README.

Please consider submitting your PR there, this repository is unmaintained.

NOTE: Patches should be against the current development branch, not against master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants