From f64a068f4b4fd765458934a79f73f03fecc2a9b7 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Thu, 24 Dec 2020 18:43:02 -0500 Subject: [PATCH] macro_recorder: don't crash trying to move line out-of-bounds --- src/main/python/macro_recorder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/python/macro_recorder.py b/src/main/python/macro_recorder.py index 6cc6009..9a59a1d 100644 --- a/src/main/python/macro_recorder.py +++ b/src/main/python/macro_recorder.py @@ -241,6 +241,8 @@ class MacroRecorder(BasicEditor): if offset == 0: return index = self.lines.index(obj) + if index + offset < 0 or index + offset >= len(self.lines): + return other = self.lines.index(self.lines[index + offset]) self.lines[index].remove() self.lines[other].remove()