fix(plotview): check return value of getSamples for export

This commit is contained in:
schneider
2016-09-01 22:45:07 +01:00
parent e936e51bca
commit 2f5f012929

View File

@@ -280,8 +280,10 @@ void PlotView::exportSamples(std::shared_ptr<AbstractSampleSource> src)
for (index = start; index < end; index += step) {
off_t length = std::min(step, end - index);
auto samples = complexSrc->getSamples(index, length);
for (auto i = 0; i < length; i += decimation.value()) {
os.write((const char*)&samples[i], 8);
if (samples != nullptr) {
for (auto i = 0; i < length; i += decimation.value()) {
os.write((const char*)&samples[i], 8);
}
}
}
}