From 7ba68a0718ea53add32d204c3776e4f3e0f68f07 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 21 Apr 2021 14:30:58 +0000 Subject: [PATCH] whoops, sorry... --- katana/src/Track.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/katana/src/Track.cpp b/katana/src/Track.cpp index d98fbbe8..08a6762e 100644 --- a/katana/src/Track.cpp +++ b/katana/src/Track.cpp @@ -1024,12 +1024,18 @@ namespace Katana { // << j+1 << "=[" << DbU::getValueString(gapsetCurr.sourceU(j+1)) // << " " << DbU::getValueString(gapsetCurr.targetU(j+1)) << "]" << endl; AutoSegment* first = _segments[gapsetCurr.span(j+1).first]->base(); - for ( AutoSegment* segment : first->getAligneds() ) { - if (segment->getSourcePosition() < first->getSourcePosition()) - first = segment; - } - // cerr << "duSource:" << DbU::getValueString(first->getDuSource()) << endl; - first->setDuSource( first->getDuSource() - spacing - minSpacing/2 ); + + cerr << "spacing:" << DbU::getValueString(spacing) << " " << first << endl; + if (first == NULL) { + cerr << Error("null first, NOT correcting gap") << endl; + } else { + for ( AutoSegment* segment : first->getAligneds() ) { + if (segment->getSourcePosition() < first->getSourcePosition()) + first = segment; + } + // cerr << "duSource:" << DbU::getValueString(first->getDuSource()) << endl; + first->setDuSource( first->getDuSource() - spacing - minSpacing/2 ); + } ++gaps; cerr << Warning( " Track::repair(): Closing same net gap in %s near:\n %s" , getString(this).c_str()