Plt Plot : Guard agains pop_back on empty vector

This commit is contained in:
Magne Sjaastad 2017-12-04 18:58:52 +01:00
parent bc026da2f6
commit efb5648721

View File

@ -371,7 +371,7 @@ public:
auto it = globCellIdxToIdxInRftFile.find(globCellIdx); auto it = globCellIdxToIdxInRftFile.find(globCellIdx);
if (it == globCellIdxToIdxInRftFile.end()) if (it == globCellIdxToIdxInRftFile.end())
{ {
if (wpExIdx == (intersections.size() - 1)) if (!m_pipeBranchWellResultPoints.empty() && wpExIdx == (intersections.size() - 1))
{ {
m_pipeBranchWellResultPoints.pop_back(); m_pipeBranchWellResultPoints.pop_back();
} }
@ -463,7 +463,7 @@ public:
auto it = globCellIdxToIdxInSimWellBranch.find(globCellIdx); auto it = globCellIdxToIdxInSimWellBranch.find(globCellIdx);
if (it == globCellIdxToIdxInSimWellBranch.end()) if (it == globCellIdxToIdxInSimWellBranch.end())
{ {
if (wpExIdx == (intersections.size() - 1)) if (!m_pipeBranchWellResultPoints.empty() && wpExIdx == (intersections.size() - 1))
{ {
m_pipeBranchWellResultPoints.pop_back(); m_pipeBranchWellResultPoints.pop_back();
} }