summaryrefslogtreecommitdiff
path: root/lisp/ledger-state.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ledger-state.el')
-rw-r--r--lisp/ledger-state.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/ledger-state.el b/lisp/ledger-state.el
index b2574b10..8fe84053 100644
--- a/lisp/ledger-state.el
+++ b/lisp/ledger-state.el
@@ -68,10 +68,12 @@
(defun ledger-state-from-string (state-string)
"Get state from STATE-CHAR."
- (cond ((string-match "\\!" state-string) 'pending)
- ((string-match "\\*" state-string) 'cleared)
- ((string-match ";" state-string) 'comment)
- (t nil)))
+ (when state-string
+ (cond
+ ((string-match "\\!" state-string) 'pending)
+ ((string-match "\\*" state-string) 'cleared)
+ ((string-match ";" state-string) 'comment)
+ (t nil))))
(defun ledger-toggle-current-posting (&optional style)
"Toggle the cleared status of the transaction under point.