Skip to content

Commit

Permalink
Merge pull request #521 from mattgibbs/fix_embedded_display_crash_on_…
Browse files Browse the repository at this point in the history
…open

Fix crash in case where base_path property isn't set.
  • Loading branch information
hhslepicka authored Jul 24, 2019
2 parents 726e44e + 352e5de commit b338ad8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pydm/widgets/embedded_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def open_file(self, force=False):
return
# Expand user (~ or ~user) and environment variables.
fname = os.path.expanduser(os.path.expandvars(self.filename))
full_fname = None
if self.base_path:
full_fname = os.path.join(self.base_path, fname)
if not is_pydm_app():
Expand All @@ -175,7 +176,7 @@ def open_file(self, force=False):
# If you get this far, you are running inside a PyDMApplication, load
# using that system.
try:
if os.path.isabs(full_fname) and os.path.exists(full_fname):
if full_fname and os.path.isabs(full_fname) and os.path.exists(full_fname):
w = self.app.open_file(full_fname, macros=self.parsed_macros())
else:
w = self.app.open_relative(fname, self,
Expand Down

0 comments on commit b338ad8

Please sign in to comment.