Skip to content

Commit 76b01e7

Browse files
committed
qtvcp -fix error message when last_path is not valid
1 parent 7b19099 commit 76b01e7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/python/qtvcp/widgets/file_manager.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,12 @@ def getCurrentSelected(self):
157157
def _hal_init(self):
158158
if self.PREFS_:
159159
last_path = self.PREFS_.getpref('last_loaded_directory', self.default_path, str, 'BOOK_KEEPING')
160-
self.updateDirectoryView(last_path)
161-
LOG.debug("lAST FILE PATH: {}".format(last_path))
160+
LOG.debug("lAST FILE PATH: {}".format(last_path))
161+
if not last_path == '' and os.path.exists(last_path):
162+
self.updateDirectoryView(last_path)
163+
else:
164+
self.updateDirectoryView(self.default_path)
165+
162166
else:
163167
LOG.debug("lAST FILE PATH: {}".format(self.default_path))
164168
self.updateDirectoryView(self.default_path)

0 commit comments

Comments
 (0)