pvif: more error checking
This commit is contained in:
@ -777,6 +777,9 @@ short PVD2DBR(pvd::ScalarType pvt)
|
|||||||
epics::pvData::FieldConstPtr
|
epics::pvData::FieldConstPtr
|
||||||
ScalarBuilder::dtype()
|
ScalarBuilder::dtype()
|
||||||
{
|
{
|
||||||
|
if(!channel)
|
||||||
|
throw std::runtime_error("+type:\"scalar\" requires +channel:");
|
||||||
|
|
||||||
short dbr = dbChannelFinalFieldType(channel);
|
short dbr = dbChannelFinalFieldType(channel);
|
||||||
const long maxelem = dbChannelFinalElements(channel);
|
const long maxelem = dbChannelFinalElements(channel);
|
||||||
const pvd::ScalarType pvt = DBR2PVD(dbr);
|
const pvd::ScalarType pvt = DBR2PVD(dbr);
|
||||||
@ -955,6 +958,9 @@ struct PlainBuilder : public PVIFBuilder
|
|||||||
|
|
||||||
// fetch the structure description
|
// fetch the structure description
|
||||||
virtual epics::pvData::FieldConstPtr dtype() OVERRIDE FINAL {
|
virtual epics::pvData::FieldConstPtr dtype() OVERRIDE FINAL {
|
||||||
|
if(!channel)
|
||||||
|
throw std::runtime_error("+type:\"plain\" requires +channel:");
|
||||||
|
|
||||||
const short dbr = dbChannelFinalFieldType(channel);
|
const short dbr = dbChannelFinalFieldType(channel);
|
||||||
const long maxelem = dbChannelFinalElements(channel);
|
const long maxelem = dbChannelFinalElements(channel);
|
||||||
const pvd::ScalarType pvt = DBR2PVD(dbr);
|
const pvd::ScalarType pvt = DBR2PVD(dbr);
|
||||||
|
Reference in New Issue
Block a user