From 604ddc092ed661aa076689a7031b034d4eac6281 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Sat, 21 Feb 2009 10:44:20 +0000 Subject: [PATCH] fix exception if no country is specified --- deluge/ui/web/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py index 8c4812617..b3123dd86 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -532,7 +532,7 @@ class Flag(resource.Resource): path = ("data", "pixmaps", "flags", request.country.lower() + ".png") filename = pkg_resources.resource_filename("deluge", os.path.join(*path)) - if filename: + if os.path.exists(filename): request.setHeader("cache-control", "public, must-revalidate, max-age=86400") request.setHeader("content-type", "image/png") data = open(filename, "rb")