From 1a8f4e182986a6579fd3d777371fac76f07f146e Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 8 Dec 2017 16:52:54 +0100 Subject: [PATCH] Linux fix --- ApplicationCode/Application/Tools/RiaSimWellBranchTools.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/Application/Tools/RiaSimWellBranchTools.cpp b/ApplicationCode/Application/Tools/RiaSimWellBranchTools.cpp index 3a90dc4bf8..e80c86d0c1 100644 --- a/ApplicationCode/Application/Tools/RiaSimWellBranchTools.cpp +++ b/ApplicationCode/Application/Tools/RiaSimWellBranchTools.cpp @@ -121,9 +121,10 @@ int RiaSimWellBranchTools::clampBranchIndex(const QString& simWellName, int bran return -1; } - if (branchIndexValue >= branches.size()) + int maxIndexValue = static_cast(branches.size()) - 1; + if (branchIndexValue > maxIndexValue) { - branchIndexValue = static_cast(branches.size()) - 1; + branchIndexValue = maxIndexValue; } return branchIndexValue;