From 0dbe8a344d9dc51e1887ec2e378e91b74bc309fd Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 1 May 2017 13:26:17 +0200 Subject: [PATCH] menubar.utils: Fix for invalid utf8 file names The previous commit made this code handle invalid directories correctly. However, it was still possible that we come across invalid file names for which :get_path() returns nil and then we assumed this was a file name. Fix this by silently ignoring such files. Signed-off-by: Uli Schlachter --- lib/menubar/utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/menubar/utils.lua b/lib/menubar/utils.lua index 1c1cfa7f..66dd2a84 100644 --- a/lib/menubar/utils.lua +++ b/lib/menubar/utils.lua @@ -272,7 +272,7 @@ function utils.parse_dir(dir_path, callback) local file_child = enum:get_child(info) if file_type == 'REGULAR' then local path = file_child:get_path() - local program = utils.parse_desktop_file(path) + local program = path and utils.parse_desktop_file(path) if program then table.insert(programs, program) end