Skip to content

Commit 445e882

Browse files
authored
check result from io.popen("xdg-user-dir DESKTOP")
1 parent d4b155d commit 445e882

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

contrib/kml_export.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ function string.escapeXmlCharacters( str )
163163
end
164164

165165
local function create_kml_file(storage, image_table, extra_data)
166-
167166
if not df.check_if_bin_exists("mkdir") then
168167
dt.print_error(_("mkdir not found"))
169168
return
@@ -357,13 +356,13 @@ local function create_kml_file(storage, image_table, extra_data)
357356

358357
-- Open the file with the standard programm
359358
if ( dt.preferences.read("kml_export","OpenKmlFile","bool") == true ) then
360-
local kmlFileOpenCommand
359+
local kmlFileOpenCommand
361360

362361
if ( dt.preferences.read("kml_export","CreateKMZ","bool") == true ) then
363362
kmlFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportKMZFilename.."\""
364363
else
365364
kmlFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportKMLFilename.."\""
366-
end
365+
end
367366
dt.control.execute(kmlFileOpenCommand)
368367
end
369368

@@ -380,6 +379,9 @@ dt.preferences.register("kml_export",
380379

381380
local handle = io.popen("xdg-user-dir DESKTOP")
382381
local result = handle:read()
382+
if (result == nil) then
383+
result = ""
384+
end
383385
handle:close()
384386
dt.preferences.register("kml_export",
385387
"ExportDirectory",

0 commit comments

Comments
 (0)