Skip to content

Commit d6b7277

Browse files
authored
Added Null Check
1 parent 0f6439b commit d6b7277

File tree

1 file changed

+4
-1
lines changed
  • extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton

1 file changed

+4
-1
lines changed

extensions/pyRevitTools.extension/pyRevit.tab/Analysis.panel/ColorSplasher.pushbutton/script.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,9 @@ def Execute(self, uiapp):
496496
# Redirect to template if one exists
497497
template_id = view.ViewTemplateId
498498
if template_id != DB.ElementId.InvalidElementId:
499-
view = new_doc.GetElement(template_id)
499+
template_view = new_doc.GetElement(template_id)
500+
if template_view:
501+
view = template_view
500502

501503
dict_filters = {}
502504
for filt_id in view.GetFilters():
@@ -633,6 +635,7 @@ def GetName(self):
633635
return "Create Filters"
634636

635637

638+
636639
class ValuesInfo:
637640
def __init__(self, para, val, idt, num1, num2, num3):
638641
self.par = para

0 commit comments

Comments
 (0)