Re: Issue with PSQL JDBC Driver Null Pointer - Mailing list pgsql-general

From Bhavesh Mistry
Subject Re: Issue with PSQL JDBC Driver Null Pointer
Date
Msg-id CAD1effjUeaPHq7y_bCxFJNSWtWBuHHsxFbfgvA5KUz1YAe9njg@mail.gmail.com
Whole thread Raw
In response to Re: Issue with PSQL JDBC Driver Null Pointer  (Dave Cramer <davecramer@postgres.rocks>)
List pgsql-general
Thanks for fixing it. 

Thanks,

Bhavesh 

On Thu, Jul 29, 2021 at 12:49 PM Dave Cramer <davecramer@postgres.rocks> wrote:


On Thu, 29 Jul 2021 at 15:44, Bhavesh Mistry <bhavesh.mistry13@gmail.com> wrote:
Hi Dave,

It still does not address the NPE issue.  If an alias is NULL. What should be the behavior?


public String getTypeForAlias(String alias) {
String type = TYPE_ALIASES.get(alias);
if (type != null) {
return type;
}
type = TYPE_ALIASES.get(alias.toLowerCase()) // NPE STILL HERE;
if (type == null) {
type = alias;
}
//populate for future use
TYPE_ALIASES.put(alias, type);
return type;
}
 

Very good question. I guess we should return null in this case.

I'll fix that

Dave


--
Thanks,

Bhavesh

pgsql-general by date:

Previous
From: Edson Carlos Ericksson Richter
Date:
Subject: Re: Issue with PSQL JDBC Driver Null Pointer
Next
From: Dhanush D
Date:
Subject: Postgres 9.6 to 12.7 pg_upgrade error - terminating connection due to administrator command