Blob Blame History Raw
From 7e79bee614187439538014444b48980a0f15dea3 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Mon, 14 Dec 2015 13:59:21 +0100
Subject: [PATCH] Do not pass None to function expecting str object

The C wrapper requires a str object. We can fix this by checking
validity of the argument in the function or we can just say that you
must pass a valid str object. I have chosen the former variant
because adding the check to the C wrapper wouldn't be so trivial
(for me).

"cmdline" is True if it is not None and is not empty. There is no need
to call the function with an empty string and the condition is easier
to comprehend.

Fixes #152

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/gnome_abrt/application.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gnome_abrt/application.py b/src/gnome_abrt/application.py
index eb18411..b5ea506 100644
--- a/src/gnome_abrt/application.py
+++ b/src/gnome_abrt/application.py
@@ -37,7 +37,7 @@ def find_application(cmdline, envp, pid, component):
     app = None
     if envp:
         app = wrappers.get_app_for_env(envp.split('\n'), int(pid))
-    if not app:
+    if not app and cmdline:
         app = wrappers.get_app_for_cmdline(cmdline)
     if not app:
         return Application(cmdline.split(" ")[0] if cmdline else None,
-- 
2.4.3