From d1c48ce7a9d478bf06fd35b4d986eb2e7d6d4bdc Mon Sep 17 00:00:00 2001 From: Berbe <4251220+Berbe@users.noreply.github.com> Date: Wed, 19 Aug 2020 02:44:53 +0200 Subject: [PATCH] Fix: Gracefully handle empty user input --- run-tests.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-tests.php b/run-tests.php index af9f309bc6dac..8d62c8337599c 100755 --- a/run-tests.php +++ b/run-tests.php @@ -942,7 +942,7 @@ function save_or_mail_results(): void flush(); $user_input = fgets($fp, 10); - $just_save_results = (strtolower($user_input[0]) == 's'); + $just_save_results = (!empty($user_input) && strtolower($user_input[0]) === 's'); } if ($just_save_results || !getenv('NO_INTERACTION') || TRAVIS_CI) {