diff --git a/Software/PC_Application/Traces/Marker/marker.cpp b/Software/PC_Application/Traces/Marker/marker.cpp index c39f4b7..0111c05 100644 --- a/Software/PC_Application/Traces/Marker/marker.cpp +++ b/Software/PC_Application/Traces/Marker/marker.cpp @@ -1560,6 +1560,9 @@ bool Marker::isMovable() // helper traces are never movable by the user return false; } + if(trace()->size() == 0) { + return false; + } switch(type) { case Type::Manual: case Type::Delta: diff --git a/Software/PC_Application/Traces/Math/tracemath.cpp b/Software/PC_Application/Traces/Math/tracemath.cpp index 2055c75..59e5695 100644 --- a/Software/PC_Application/Traces/Math/tracemath.cpp +++ b/Software/PC_Application/Traces/Math/tracemath.cpp @@ -84,7 +84,14 @@ TraceMath::TypeInfo TraceMath::getInfo(TraceMath::Type type) TraceMath::Data TraceMath::getSample(unsigned int index) { - return data.at(index); + if(index < data.size()) { + return data[index]; + } else { + TraceMath::Data d; + d.x = 0; + d.y = 0; + return d; + } } double TraceMath::getStepResponse(unsigned int index)