Skip to content

Commit

Permalink
AttributeError: 'NoneType' object has no attribute 'name'
Browse files Browse the repository at this point in the history
Exception in thread Thread-45:
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "F:\SublimeText\Data\Packages\PlantUmlDiagrams\diagram\__init__.py", line 126, in render_and_view
    print("%r viewing %r" % (ACTIVE_VIEWER, [d.name for d in diagram_files]))
  File "F:\SublimeText\Data\Packages\PlantUmlDiagrams\diagram\__init__.py", line 126, in <listcomp>
    print("%r viewing %r" % (ACTIVE_VIEWER, [d.name for d in diagram_files]))
AttributeError: 'NoneType' object has no attribute 'name'
  • Loading branch information
evandrocoan committed Feb 12, 2018
1 parent b3563b1 commit 7a89dee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion diagram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def render_and_view(sourceFile, diagrams):
diagram_files.extend(processor.process(sourceFile, blocks))

if diagram_files:
print("%r viewing %r" % (ACTIVE_VIEWER, [d.name for d in diagram_files]))
print("%r viewing %r" % (ACTIVE_VIEWER, [d.name for d in diagram_files if d]))
ACTIVE_VIEWER.view(diagram_files)
else:
error_message("No diagrams generated...")
3 changes: 2 additions & 1 deletion diagram/sublime3.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ def load(self):

def view(self,diagram_files):
for diagram_file in diagram_files:
sublime.active_window().open_file(diagram_file.name)
if diagram_file:
sublime.active_window().open_file(diagram_file.name)

0 comments on commit 7a89dee

Please sign in to comment.