diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index 9030e5594..3f2de01f9 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -2025,13 +2025,14 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback): """ In DbGeneric, the database is in a text file at the path """ - filepath = os.path.join(self._directory, "name.txt") - try: - with open(filepath, "r") as name_file: - name = name_file.readline().strip() - except (OSError, IOError) as msg: - LOG.error(str(msg)) - name = None + name = None + if self._directory: + filepath = os.path.join(self._directory, "name.txt") + try: + with open(filepath, "r") as name_file: + name = name_file.readline().strip() + except (OSError, IOError) as msg: + LOG.error(str(msg)) return name def _order_by_person_key(self, person):