Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in JobConsumerExecutor #34

Open
andhie opened this issue Jul 21, 2015 · 1 comment
Open

NPE in JobConsumerExecutor #34

andhie opened this issue Jul 21, 2015 · 1 comment

Comments

@andhie
Copy link

andhie commented Jul 21, 2015

In JobConsumerExecutor.java the method below causes a NPE due to val being null

private boolean contains(String[] arr, String val) {
    for (int i = 0; i < arr.length; i ++) {
        if (val.equals(arr[i])) {
            return true;
        }
    }
    return false;
}

I'm implementing ActivityBoundJobs as described in the Wiki, and cancelling Jobs when activity goes onStop().
Scenario: Activity1 launches Activity2. Activity2 calls an API to get data and JobConsumerExecutor crashes

@Override
protected void onStop() {
    super.onStop();
    MyApplication.getInstance()
            .getJobManager()
            .cancelJobsInBackground(null, TagConstraint.ANY, sessionId);
}
@yigit
Copy link
Owner

yigit commented Mar 26, 2016

are you sure you are not passing null sessionId?

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

No branches or pull requests

2 participants