diff --git a/tests/test_main.py b/tests/test_main.py index f2c2843e..af8c09aa 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -61,6 +61,7 @@ def test_get_command(): stdout=PIPE, stderr=PIPE, env={'LANG': 'C'}) + assert main.get_command(Mock(), ['']) is None def test_get_matched_rule(): diff --git a/thefuck/main.py b/thefuck/main.py index 626a1ef7..b3e0ee27 100644 --- a/thefuck/main.py +++ b/thefuck/main.py @@ -80,6 +80,10 @@ def get_command(settings, args): script = ' '.join(arg.decode('utf-8') for arg in args[1:]) else: script = ' '.join(args[1:]) + + if not script: + return + result = Popen(script, shell=True, stdout=PIPE, stderr=PIPE, env=dict(os.environ, LANG='C')) if wait_output(settings, result):