aspects: Fix off-by-one error when printing subcontrols (#151)

This commit is contained in:
Peter Hartmann 2021-11-22 15:50:18 +01:00 committed by GitHub
parent 927d2dd51c
commit 0657f1120c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -102,7 +102,7 @@ QByteArray QskAspect::subControlName( Subcontrol subControl )
const auto& names = qskAspectRegistry->subControlNames; const auto& names = qskAspectRegistry->subControlNames;
const int index = subControl; const int index = subControl;
if ( index > 0 && index < names.size() ) if ( index > 0 && index <= names.size() )
return names[ index - 1 ]; return names[ index - 1 ];
return QByteArray(); return QByteArray();