From cd084c8ba66d83ff3a41998410856074d98f9848 Mon Sep 17 00:00:00 2001 From: nvbn Date: Mon, 20 Jul 2015 19:30:41 +0300 Subject: [PATCH] #N/A Fix history rule with blank history --- thefuck/rules/history.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thefuck/rules/history.py b/thefuck/rules/history.py index cb424f7..765d9af 100644 --- a/thefuck/rules/history.py +++ b/thefuck/rules/history.py @@ -11,7 +11,8 @@ def _not_corrected(history, tf_alias): if previous is not None and line != tf_alias: yield previous previous = line - yield history[-1] + if history: + yield history[-1] @memoize