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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2012-06-05 17:44:30 +02:00
parent ca2fc7811a
commit d0f3e399d7
1 changed files with 3 additions and 2 deletions

View File

@ -525,8 +525,9 @@ if capi.dbus then
args.preset = util.table.join(args.preset, preset) args.preset = util.table.join(args.preset, preset)
end end
end end
if not args.preset.callback or (type(args.preset.callback) == "function" and local preset = args.preset or config.defaults
args.preset.callback(data, appname, replaces_id, icon, title, text, actions, hints, expire)) then 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 if icon ~= "" then
args.icon = icon args.icon = icon
elseif hints.icon_data or hints.image_data then elseif hints.icon_data or hints.image_data then