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

NullPointerException in case of permission denied errors #25

Merged
merged 1 commit into from Sep 18, 2012

Conversation

lgfischer
Copy link
Contributor

There are cases that the instantiation of the JobStatusMonitor class will fail, for example, if the credentials used don't have permissions to access the required resources.

If the instantiation of the JobStatusMonitor fail (lines 320 or 322 of the ArchiveTransferManager.java file), an exception describing the error will be thrown. But the finally clause at the end of the method will call shutdown() on an null object, resulting in a new NullPointerException. This new exception makes hard to the user to know what failed during the API execution.

This change checks if the jobStatusMonitor variable is not null before calling shutdown(). This way, if an error occurs, the exception with a clear message can be caught by the user.

…rmission denied exception, for example), calling shutdown() on a null object will throw a NullPointerException, hidding the previous exception.
zachmu pushed a commit that referenced this pull request Sep 18, 2012
NullPointerException in case of permission denied errors
@zachmu zachmu merged commit 28d3fc4 into aws:master Sep 18, 2012
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

Successfully merging this pull request may close these issues.

None yet

2 participants