(battery-linux-proc-acpi): Check `capacity' for non-nil
[bpt/emacs.git] / lisp / battery.el
index 65b8baf..34f74aa 100644 (file)
@@ -391,8 +391,8 @@ The following %-sequences are provided:
                                         rate-type)) "N/A"))
          (cons ?B (or charging-state "N/A"))
          (cons ?b (or (and (string= charging-state "charging") "+")
-                      (and (< capacity low) "!")
-                      (and (< capacity warn) "-")
+                      (and capacity (< capacity low) "!")
+                      (and capacity (< capacity warn) "-")
                       ""))
          (cons ?h (or (and hours (number-to-string hours)) "N/A"))
          (cons ?m (or (and minutes (number-to-string minutes)) "N/A"))