Fixed coverity issues

169009 Bad use of null-like value
169005 Bad use of null-like value
169003 Bad use of null-like value
169000 Bad use of null-like value
168998 Bad use of null-like value
168996 Structurally dead code
This commit is contained in:
Yorik van Havre
2018-11-20 12:37:32 -02:00
parent 11da78f582
commit 88f47ee725
6 changed files with 21 additions and 9 deletions

View File

@@ -448,6 +448,11 @@ class _Panel(ArchComponent.Component):
import Part #, DraftGeomUtils
layers = []
length = 0
width = 0
thickness = 0
# base tests
if obj.Base:
if obj.Base.isDerivedFrom("Part::Feature"):
@@ -473,7 +478,6 @@ class _Panel(ArchComponent.Component):
elif obj.Base.isDerivedFrom("Part::Feature"):
if not obj.Base.Shape.Solids:
return
layers = []
if hasattr(obj,"Material"):
if obj.Material:
if hasattr(obj.Material,"Materials"):

View File

@@ -1445,7 +1445,7 @@ class _ViewProviderWindow(ArchComponent.ViewProviderComponent):
if 'DiffuseColor' in mat.Material:
if "(" in mat.Material['DiffuseColor']:
ccol = tuple([float(f) for f in mat.Material['DiffuseColor'].strip("()").split(",")])
if 'Transparency' in mat.Material:
if ccol and ('Transparency' in mat.Material):
ccol = (ccol[0],ccol[1],ccol[2],float(mat.Material['Transparency']))
if not ccol:
typeidx = (i*5)+1