pivy: avoid possible segfault when setting None to an SoSFImage field

This commit is contained in:
wmayer
2019-11-28 15:44:42 +01:00
parent 2efd9a133e
commit 58fdbdc4d1

View File

@@ -1071,7 +1071,9 @@ class _ViewProviderWall(ArchComponent.ViewProviderComponent):
self.Object = vobj.Object
from pivy import coin
tex = coin.SoTexture2()
tex.image = Draft.loadTexture(Draft.svgpatterns()['simple'][1], 128)
image = Draft.loadTexture(Draft.svgpatterns()['simple'][1], 128)
if not image is None:
tex.image = image
texcoords = coin.SoTextureCoordinatePlane()
s = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetFloat("patternScale",0.01)
texcoords.directionS.setValue(s,0,0)