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

Fix null check in getTablePrivileges #453

Merged
merged 1 commit into from Dec 15, 2015

Conversation

Projects
None yet
3 participants
@marschall
Contributor

marschall commented Dec 13, 2015

AbstractJdbc2DatabaseMetaData.getTablePrivileges contains the following
code:

// report the owner as grantor if it's missing
String grantor = grantTuple[0].equals(null) ? owner : grantTuple[0];

This will cause a NullPointerException if the grantor is missing
instead of using the owner because you can't call #equals (or any
method) on null.

The code should read

// report the owner as grantor if it's missing
String grantor = grantTuple[0] == null ? owner : grantTuple[0];
Fix null check in getTablePrivileges
The null check to report the owner as grantor if it's missing is
broken.
@vlsi

This comment has been minimized.

Member

vlsi commented Dec 13, 2015

👍

davecramer added a commit that referenced this pull request Dec 15, 2015

Merge pull request #453 from marschall/null-check
Fix null check in getTablePrivileges

@davecramer davecramer merged commit 69e92f1 into pgjdbc:master Dec 15, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment