Skip to content

Commit

Permalink
#2362 Grdecl SegFault: Guard for empty vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebecca Cox committed Jan 24, 2018
1 parent 650fc21 commit 0ea10a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ApplicationCode/UserInterface/RiuResultQwtPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ RiuResultQwtPlot::~RiuResultQwtPlot()
//--------------------------------------------------------------------------------------------------
void RiuResultQwtPlot::addCurve(const QString& curveName, const cvf::Color3f& curveColor, const std::vector<QDateTime>& dateTimes, const std::vector<double>& timeHistoryValues)
{
if (dateTimes.empty() || timeHistoryValues.empty())
{
return;
}

RiuLineSegmentQwtPlotCurve* plotCurve = new RiuLineSegmentQwtPlotCurve("Curve 1");

plotCurve->setSamplesFromDatesAndYValues(dateTimes, timeHistoryValues, false);
Expand Down

0 comments on commit 0ea10a4

Please sign in to comment.