From d81e3e781bada692772fa9bc027a5538801a2234 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sun, 28 Aug 2016 16:11:40 +0300 Subject: [PATCH] fix #20 --- toxygen/list_items.py | 4 +++- toxygen/smileys.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/toxygen/list_items.py b/toxygen/list_items.py index 4d57d92..b782231 100644 --- a/toxygen/list_items.py +++ b/toxygen/list_items.py @@ -25,7 +25,9 @@ class MessageEdit(QtGui.QTextBrowser): self.setOpenExternalLinks(True) self.setAcceptRichText(True) self.setOpenLinks(False) - self.setSearchPaths([smileys.SmileyLoader.get_instance().get_smileys_path()]) + path = smileys.SmileyLoader.get_instance().get_smileys_path() + if path is not None: + self.setSearchPaths([path]) self.document().setDefaultStyleSheet('a { color: #306EFF; }') text = self.decoratedText(text) if message_type != TOX_MESSAGE_TYPE['NORMAL']: diff --git a/toxygen/smileys.py b/toxygen/smileys.py index 9143a0b..6031ac4 100644 --- a/toxygen/smileys.py +++ b/toxygen/smileys.py @@ -48,7 +48,7 @@ class SmileyLoader(util.Singleton): print('Smiley pack {} was not loaded. Error: {}'.format(pack_name, ex)) def get_smileys_path(self): - return util.curr_directory() + '/smileys/' + self._curr_pack + '/' + return util.curr_directory() + '/smileys/' + self._curr_pack + '/' if self._curr_pack is not None else None def get_packs_list(self): d = util.curr_directory() + '/smileys/'