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

Fix null check in getTablePrivileges #453

Merged
merged 1 commit into from Dec 15, 2015
Merged

Conversation

@marschall
Copy link
Contributor

@marschall 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];
The null check to report the owner as grantor if it's missing is
broken.
@vlsi
Copy link
Member

@vlsi vlsi commented Dec 13, 2015

👍

davecramer added a commit that referenced this pull request Dec 15, 2015
Fix null check in getTablePrivileges
@davecramer davecramer merged commit 69e92f1 into pgjdbc:master Dec 15, 2015
1 check passed
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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants