Bugfix bedtools closest: Do not segfault when b file is empty.
Only try to print a null record when the record type is known.
In case of an empty b file, the record type can not be determined.
This fixes "Segmentation fault with closestBed":
@@ -510,9 +510,11 @@ void RecordOutputMgr::null(bool queryType, bool dbType)
default:
break;
}
+ if (dummyRecord) {
dummyRecord->printNull(_outBuf);
delete dummyRecord;
}
+}
void RecordOutputMgr::printKey(const Record *key, const string & start, const string & end)
{
