Linux fix

This commit is contained in:
Magne Sjaastad 2017-12-08 16:52:54 +01:00
parent 2c4b1e453d
commit 1a8f4e1829

View File

@ -121,9 +121,10 @@ int RiaSimWellBranchTools::clampBranchIndex(const QString& simWellName, int bran
return -1; return -1;
} }
if (branchIndexValue >= branches.size()) int maxIndexValue = static_cast<int>(branches.size()) - 1;
if (branchIndexValue > maxIndexValue)
{ {
branchIndexValue = static_cast<int>(branches.size()) - 1; branchIndexValue = maxIndexValue;
} }
return branchIndexValue; return branchIndexValue;