]> git.rmz.io Git - dotfiles.git/commitdiff
awesome/mpd_widget: fix nil access
authorSamir Benmendil <me@rmz.io>
Fri, 6 Sep 2024 12:11:39 +0000 (13:11 +0100)
committerSamir Benmendil <me@rmz.io>
Fri, 6 Sep 2024 12:29:03 +0000 (13:29 +0100)
Maybe address the issue where widget becomes unresponsive when the
playlist is emptied.

awesome/widgets/mpd_widget.lua

index ccd131e304ccc94042c0b086ceabe292cf994a12..956fa4ca2d927afa44acb24daea9d775d042f316 100644 (file)
@@ -22,6 +22,10 @@ widget.scroll = wibox.widget {
 }
 
 function widget:update_widget()
+    if not self._currentsong then
+        self._textbox.text = ""
+        return
+    end
     local text = ""
     local artist = self._currentsong.artist
     local title = self._currentsong.title