throw exception instead of causing access violation
This commit is contained in:
parent
082293e58a
commit
167f5b1386
1 changed files with 6 additions and 2 deletions
|
|
@ -27,9 +27,13 @@ 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);
|
||||||
|
if (type) {
|
||||||
|
Oid oid = type->oid();
|
||||||
params.add(e.value, oid);
|
params.add(e.value, oid);
|
||||||
}
|
}
|
||||||
|
throw std::runtime_error("missing type in parameter list");
|
||||||
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue