diff --git a/PowerEditor/src/MISC/Common/Sorters.h b/PowerEditor/src/MISC/Common/Sorters.h index 365192d51..144e8c206 100644 --- a/PowerEditor/src/MISC/Common/Sorters.h +++ b/PowerEditor/src/MISC/Common/Sorters.h @@ -48,6 +48,12 @@ protected: { if (isSortingSpecificColumns()) { + // prevent an std::out_of_range exception + if (input.length() < _fromColumn) + { + return TEXT(""); + } + return input.substr(_fromColumn, 1 + _toColumn - _fromColumn); } else