From d0f3e399d7d88bf3ae1047ddeca244b8ac381090 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 5 Jun 2012 17:44:30 +0200 Subject: [PATCH] Fix naughty notifications again When something sends notifications which don't get mapped into some preset, args.preset would be nil and indexing nil throws a lua error. Fix this by using the default preset in that case. Signed-off-by: Uli Schlachter --- lib/naughty.lua.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in index 619ddd91e..a61fadddc 100644 --- a/lib/naughty.lua.in +++ b/lib/naughty.lua.in @@ -525,8 +525,9 @@ if capi.dbus then args.preset = util.table.join(args.preset, preset) end end - if not args.preset.callback or (type(args.preset.callback) == "function" and - args.preset.callback(data, appname, replaces_id, icon, title, text, actions, hints, expire)) then + local preset = args.preset or config.defaults + if not preset.callback or (type(preset.callback) == "function" and + preset.callback(data, appname, replaces_id, icon, title, text, actions, hints, expire)) then if icon ~= "" then args.icon = icon elseif hints.icon_data or hints.image_data then