From 74feef4718770d20273aa97f9176484149f178ae Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 12 Dec 2018 11:25:33 +0100 Subject: Improve config error handling --- src/SparseMatrixProjectionGeometry2D.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/SparseMatrixProjectionGeometry2D.cpp') diff --git a/src/SparseMatrixProjectionGeometry2D.cpp b/src/SparseMatrixProjectionGeometry2D.cpp index b55a282..e8165a3 100644 --- a/src/SparseMatrixProjectionGeometry2D.cpp +++ b/src/SparseMatrixProjectionGeometry2D.cpp @@ -93,12 +93,13 @@ bool CSparseMatrixProjectionGeometry2D::initialize(const Config& _cfg) ConfigStackCheck CC("SparseMatrixProjectionGeometry2D", this, _cfg); // initialization of parent class - CProjectionGeometry2D::initialize(_cfg); + if (!CProjectionGeometry2D::initialize(_cfg)) + return false; // get matrix XMLNode node = _cfg.self.getSingleNode("MatrixID"); ASTRA_CONFIG_CHECK(node, "SparseMatrixProjectionGeometry2D", "No MatrixID tag specified."); - int id = node.getContentInt(); + int id = StringUtil::stringToInt(node.getContent(), -1); m_pMatrix = CMatrixManager::getSingleton().get(id); CC.markNodeParsed("MatrixID"); -- cgit v1.2.3