aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Hintsanen <petterih@iki.fi>2021-02-22 22:05:26 +0200
committerPetteri Hintsanen <petterih@iki.fi>2021-02-23 00:05:15 +0200
commitfa8f64e6a98373922c88af01d87046af2497d03d (patch)
treefe4bdae50bce5adaa5b5ae36350217733b08ac9a
parent60c93048ee2acd557f4c102323b779b5092f6662 (diff)
Fix whitespace trimming
Don't try to trim nil.
-rw-r--r--emms-info-native.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/emms-info-native.el b/emms-info-native.el
index d0c9777..0c7a220 100644
--- a/emms-info-native.el
+++ b/emms-info-native.el
@@ -753,12 +753,13 @@ Supports Ogg Vorbis/Opus, FLAC, and MP3 files."
(info-fields (emms-info-native--decode-info-fields filename)))
(dolist (field info-fields)
(let ((name (intern (concat "info-" (car field))))
- (value (string-trim-right (cdr field))))
- (emms-track-set track
- name
- (if (eq name 'info-playing-time)
- (string-to-number value)
- value))))))
+ (value (cdr field)))
+ (unless (zerop (length value))
+ (emms-track-set track
+ name
+ (if (eq name 'info-playing-time)
+ (string-to-number value)
+ (string-trim-right value))))))))
(defun emms-info-native--decode-info-fields (filename)
"Decode info fields from FILENAME.