Blob Blame History Raw
From 87b9ec3914b720966436a069563c25a5a844f556 Mon Sep 17 00:00:00 2001
From: James Ross <itzexor@gmail.com>
Date: Wed, 16 Oct 2019 14:46:30 -0700
Subject: [PATCH] obex: check for None when setting shared path

g_get_user_special_dir() can return NULL/None but os.path.exists()
doesn't accept NoneType so we have to check for it, or catch the
exception.
---
 usr/lib/blueberry/blueberry-obex-agent.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr/lib/blueberry/blueberry-obex-agent.py b/usr/lib/blueberry/blueberry-obex-agent.py
index 50381a0..370bd59 100755
--- a/usr/lib/blueberry/blueberry-obex-agent.py
+++ b/usr/lib/blueberry/blueberry-obex-agent.py
@@ -32,7 +32,7 @@
 BOLD = lambda x: "\033[1m" + x + "\033[0m"
 
 SHARED_PATH = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DOWNLOAD)
-if not os.path.exists(SHARED_PATH):
+if SHARED_PATH is None or not os.path.exists(SHARED_PATH):
     SHARED_PATH = os.path.expanduser("~")
 
 # i18n