Closes rhbz#949979
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/gnome_abrt/application.py | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/src/gnome_abrt/application.py b/src/gnome_abrt/application.py
index ae32113..8f1ff85 100644
--- a/src/gnome_abrt/application.py
+++ b/src/gnome_abrt/application.py
@@ -49,6 +49,8 @@ def compare_executable(executable, desktop_entry):
return False
dexec = desktop_entry.get_executable()
+ if not dexec:
+ return False
realpath = None
if executable[0] == '/' and os.path.islink(executable):
@@ -66,9 +68,14 @@ def compare_executable(executable, desktop_entry):
or (realpath and compare_executable(realpath, desktop_entry)))
def compare_cmdline(cmdline, desktop_entry):
+ if not cmdline:
+ return False
+
+ ret = False
dcmdline = desktop_entry.get_commandline()
- ret = (os.path.basename(cmdline) == os.path.basename(dcmdline)
- or cmdline == dcmdline)
+ if dcmdline:
+ ret = (os.path.basename(cmdline) == os.path.basename(dcmdline)
+ or cmdline == dcmdline)
# try to handle interpreters like python
if not ret:
@@ -84,10 +91,18 @@ def compare_component(component, desktop_entry):
return False
if isinstance(dicon, Gio.ThemedIcon):
- return component in dicon.get_names()
+ names = dicon.get_names()
+ if not names:
+ return False
+ return component in names
elif isinstance(dicon, Gio.FileIcon):
- logging.debug("File icon: {0}".format(dicon.to_string()))
- base_name = os.path.basename(dicon.to_string())
+ str_dicon = dicon.to_string()
+ if not str_dicon:
+ logging.debug("File icon which cannot be convert to string")
+ return False
+
+ logging.debug("File icon: {0}".format())
+ base_name = os.path.basename(str_dicon)
if component == base_name:
return True
elif '.' in base_name:
--
1.8.1.4