From 273b3c97a58c64f4754aa1f2b5a436fb35c9091c Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Thu, 25 May 2023 13:24:14 -0400 Subject: [PATCH] Throw an error when trying to copy a line that does exist, but is blank Former-commit-id: 15449013e83cb2454771399594305cf82150bd9c Former-commit-id: ffe3d6a89cb1cfd86bbfb2beadce5510f143ff92 --- lib/sshyp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sshyp.py b/lib/sshyp.py index 6d8709d..74b9193 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -646,6 +646,10 @@ def copy_data(): _index = 2 elif arguments[2] in ('note', '-n'): _index = 3 + _copy_subject = _copy_line[_index] + # ensure field is not blank + if _copy_subject == '': + raise IndexError # PORT START CLIPBOARD # WSL clipboard detection if 'WSL_DISTRO_NAME' in environ: