From 76b1d348a15f2a81f14ab4feee369e50fbe2a41c Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 15 Jan 2016 18:47:09 +0100 Subject: [PATCH] imagebox: Remove dead code Since some commits, surface.load() handles printing an error message for us. Signed-off-by: Uli Schlachter --- lib/wibox/widget/imagebox.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/wibox/widget/imagebox.lua b/lib/wibox/widget/imagebox.lua index 14eb1315..40e4a644 100644 --- a/lib/wibox/widget/imagebox.lua +++ b/lib/wibox/widget/imagebox.lua @@ -72,17 +72,16 @@ end --- Set an imagebox' image -- @param image Either a string or a cairo image surface. A string is -- interpreted as the path to a png image file. +-- @return true on success, false if the image cannot be used function imagebox:set_image(image) local image = image if type(image) == "string" then - local success, result = pcall(surface.load, image) - if not success then - print("Error while reading '" .. image .. "': " .. result) + image = surface.load(image) + if not image then print(debug.traceback()) return false end - image = result end image = surface.load(image)