Fixed coverity issues
184298 Bad use of null-like value 183849 Bad use of null-like value 183846 Bad use of null-like value 183845 Copy-paste error 183844 Bad use of null-like value
This commit is contained in:
@@ -243,7 +243,7 @@ def makeRailing(stairs):
|
||||
stairs[0].Additions = railList
|
||||
break
|
||||
elif stair.OutlineRight:
|
||||
lrRailWire = Draft.makeWire(stair.OutlineLeft)
|
||||
lrRailWire = Draft.makeWire(stair.OutlineRight)
|
||||
lrRail.Base = lrRailWire
|
||||
stair.OutlineWireRight = lrRailWire.Name
|
||||
railList = stair.Additions
|
||||
@@ -735,6 +735,7 @@ class _Stairs(ArchComponent.Component):
|
||||
|
||||
vNose = DraftVecUtils.scaleTo(vLength,-abs(obj.Nosing.Value))
|
||||
h = 0
|
||||
l = 0
|
||||
|
||||
if obj.RiserHeightEnforce != 0:
|
||||
h = obj.RiserHeightEnforce * numberofsteps
|
||||
@@ -805,6 +806,7 @@ class _Stairs(ArchComponent.Component):
|
||||
# structure
|
||||
lProfile = []
|
||||
struct = None
|
||||
p5 = None
|
||||
p7 = None
|
||||
p1 = p1.add(DraftVecUtils.neg(vNose))
|
||||
p2 = p1.add(Vector(0,0,-fHeight)).add(Vector(0,0,-obj.StructureThickness.Value/math.cos(a)))
|
||||
@@ -854,7 +856,7 @@ class _Stairs(ArchComponent.Component):
|
||||
p1c = p1.add(DraftVecUtils.scaleTo(vLength,reslength))
|
||||
p5b = None
|
||||
p5c = None
|
||||
if obj.TreadThickness.Value:
|
||||
if obj.TreadThickness.Value and p5:
|
||||
reslength = obj.StructureThickness.Value/math.sin(a)
|
||||
p5b = p5.add(DraftVecUtils.scaleTo(vLength,-reslength))
|
||||
reslength = obj.TreadThickness.Value/math.tan(a)
|
||||
@@ -1112,7 +1114,8 @@ class _Stairs(ArchComponent.Component):
|
||||
p3r = self.align(p2,"Right",-vWidth) # -ve / opposite direction of "Right" - no "Left" in _Stairs.Align()
|
||||
else:
|
||||
print("Should have a bug here, if see this")
|
||||
p4r = p3r.add(DraftVecUtils.scale(-vLength,obj.NumberOfSteps-(landing+1)).add(Vector(0,0,(obj.NumberOfSteps-landing)*hstep)))
|
||||
if p3r:
|
||||
p4r = p3r.add(DraftVecUtils.scale(-vLength,obj.NumberOfSteps-(landing+1)).add(Vector(0,0,(obj.NumberOfSteps-landing)*hstep)))
|
||||
else:
|
||||
p4 = p3.add(DraftVecUtils.scale(vLength,obj.NumberOfSteps-(landing+1)).add(Vector(0,0,(obj.NumberOfSteps-landing)*hstep)))
|
||||
self.makeStraightLanding(obj,Part.LineSegment(p2,p3).toShape(), None, True)
|
||||
|
||||
@@ -334,6 +334,7 @@ def fill_femresult_stats(results):
|
||||
''' fills a FreeCAD FEM mechanical result object with stats data
|
||||
'''
|
||||
# result stats, set stats values to 0, they may not exist
|
||||
no_of_values = 1 # to avoid division by zero
|
||||
x_min = y_min = z_min = x_max = y_max = z_max = x_avg = y_avg = z_avg = 0
|
||||
a_max = a_min = a_avg = s_max = s_min = s_avg = 0
|
||||
p1_min = p1_avg = p1_max = p2_min = p2_avg = p2_max = p3_min = p3_avg = p3_max = 0
|
||||
|
||||
Reference in New Issue
Block a user