httpserver: Fix crash if supybot.servers.http.favicon has not been set.

This commit is contained in:
Valentin Lorentz 2014-04-15 18:39:44 +00:00
parent cdb14ec4f5
commit 90a1208e9e

View File

@ -358,10 +358,10 @@ class Favicon(SupyHTTPServerCallback):
name = 'favicon' name = 'favicon'
defaultResponse = _('Request not handled') defaultResponse = _('Request not handled')
def doGet(self, handler, path): def doGet(self, handler, path):
response = None
file_path = conf.supybot.servers.http.favicon() file_path = conf.supybot.servers.http.favicon()
found = False found = False
if file_path: if file_path:
response = None
try: try:
icon = open(file_path, 'rb') icon = open(file_path, 'rb')
response = icon.read() response = icon.read()