throw exception instead of causing access violation

This commit is contained in:
eelke 2019-09-26 20:14:35 +02:00
parent 082293e58a
commit 167f5b1386

View file

@ -27,8 +27,12 @@ Pgsql::Params QueryParamListController::params() const
// some types have two names that are in seperate fields // some types have two names that are in seperate fields
// this function only checks one field currently :( // this function only checks one field currently :(
// for example integer vs int4, bigint vs int8 // for example integer vs int4, bigint vs int8
Oid oid = types->getByName(e.type)->oid(); auto type = types->getByName(e.type);
params.add(e.value, oid); if (type) {
Oid oid = type->oid();
params.add(e.value, oid);
}
throw std::runtime_error("missing type in parameter list");
} }
return params; return params;
} }