From b63c443d3db24f8bce9fa1ea6b3f24d99b97cffe Mon Sep 17 00:00:00 2001 From: Jonathan Redpath Date: Tue, 26 Oct 2021 23:24:48 +0100 Subject: [PATCH] Add missing safety check to prevent error when clicking DUPLICATE item that doesn't exist --- Nasal/MCDU/DUPLICATE.nas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Nasal/MCDU/DUPLICATE.nas b/Nasal/MCDU/DUPLICATE.nas index 9e6c58ee..c5496993 100644 --- a/Nasal/MCDU/DUPLICATE.nas +++ b/Nasal/MCDU/DUPLICATE.nas @@ -134,6 +134,11 @@ var duplicateNamesPage = { } }, pushButtonLeft: func(indexSelect) { + if (indexSelect > size(me.vector)) { + mcdu_message(me.computer, "NOT ALLOWED"); + return; + } + if (!dirToFlag) { if (!me.flagPBD and !me.flagPROG) { if (size(me.vector[0].id) == 5) {