mirror of https://github.com/citusdata/citus.git
null check for server in GetObjectAddressByServerName (#6095)
parent
5670dffd33
commit
789d5b9ef9
|
@ -269,7 +269,7 @@ static List *
|
||||||
GetObjectAddressByServerName(char *serverName, bool missing_ok)
|
GetObjectAddressByServerName(char *serverName, bool missing_ok)
|
||||||
{
|
{
|
||||||
ForeignServer *server = GetForeignServerByName(serverName, missing_ok);
|
ForeignServer *server = GetForeignServerByName(serverName, missing_ok);
|
||||||
Oid serverOid = server->serverid;
|
Oid serverOid = (server) ? server->serverid : InvalidOid;
|
||||||
ObjectAddress *address = palloc0(sizeof(ObjectAddress));
|
ObjectAddress *address = palloc0(sizeof(ObjectAddress));
|
||||||
ObjectAddressSet(*address, ForeignServerRelationId, serverOid);
|
ObjectAddressSet(*address, ForeignServerRelationId, serverOid);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue