summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-06-25 21:38:46 +0200
committerDaniel M. Pelt <D.M.Pelt@cwi.nl>2015-06-25 21:38:46 +0200
commitf1a8bd8d2b62b089a90fef55268e3300581717ed (patch)
tree39b430b0bcae1ee310ba9e8486b79f844d65a4dd
parent26713deae284d6bb793b728c7af2db28a7484054 (diff)
downloadastra-f1a8bd8d2b62b089a90fef55268e3300581717ed.tar.gz
astra-f1a8bd8d2b62b089a90fef55268e3300581717ed.tar.bz2
astra-f1a8bd8d2b62b089a90fef55268e3300581717ed.tar.xz
astra-f1a8bd8d2b62b089a90fef55268e3300581717ed.zip
Add extra null check for ExtraDetectorOffset
-rw-r--r--src/ParallelProjectionGeometry2D.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ParallelProjectionGeometry2D.cpp b/src/ParallelProjectionGeometry2D.cpp
index 5f51d08..7260b83 100644
--- a/src/ParallelProjectionGeometry2D.cpp
+++ b/src/ParallelProjectionGeometry2D.cpp
@@ -180,9 +180,11 @@ Config* CParallelProjectionGeometry2D::getConfiguration() const
cfg->self.addChildNode("DetectorCount", getDetectorCount());
cfg->self.addChildNode("DetectorWidth", getDetectorWidth());
cfg->self.addChildNode("ProjectionAngles", m_pfProjectionAngles, m_iProjectionAngleCount);
- XMLNode opt = cfg->self.addChildNode("Option");
- opt.addAttribute("key","ExtraDetectorOffset");
- opt.setContent(m_pfExtraDetectorOffset, m_iProjectionAngleCount);
+ if(m_pfExtraDetectorOffset!=NULL){
+ XMLNode opt = cfg->self.addChildNode("Option");
+ opt.addAttribute("key","ExtraDetectorOffset");
+ opt.setContent(m_pfExtraDetectorOffset, m_iProjectionAngleCount);
+ }
return cfg;
}
//----------------------------------------------------------------------------------------