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 <psychon@znc.in>
This commit is contained in:
parent
f958b6a023
commit
0dbe8a344d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue