mirror of https://github.com/jetkvm/kvm.git
return error rather than truncate steps in validation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
2766f50dce
commit
7cac28926a
|
@ -61,7 +61,7 @@ func (m *KeyboardMacro) Validate() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(m.Steps) > MaxStepsPerMacro {
|
if len(m.Steps) > MaxStepsPerMacro {
|
||||||
m.Steps = m.Steps[:MaxStepsPerMacro]
|
return fmt.Errorf("too many steps in macro (max %d)", MaxStepsPerMacro)
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range m.Steps {
|
for i := range m.Steps {
|
||||||
|
|
Loading…
Reference in New Issue