pyBox2d, contactpoints and userdata

not sure if this is a bug, but...
whenever i try to get the userdata of a shapebody of a contactpoint, my program crashes.

e.g. in the demo_main.py of the testbed, i add the line:
Code:
print cp.shape1.GetBody().GetUserData()

in the handleCall function, after the line
Code:
cp.state = state

i get an error:
Code:
Fatal Python error: (pygame parachute) Segmentation Fault

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.


btw, this also happens, when i try to GetUserData of a contactpoint-shape before or after the StepFunction...

is this a bug or what am i doing wrong?
greetz

p.s. i am using winxp, python 2.5, pyBox2D-2.0.2b0.win32-py2.5.exe
btw, when i do a:
Code:
print dir(cp.shape1.GetBody())

i get this:
Code:
['AllowSleeping', 'ApplyForce', 'ApplyImpulse',..., 'GetUserData', ....]

e.g. i get no error with this:
Code:
cp.shape1.GetBody().GetAngle()


pretty weird, isn't it?
ok i found the problem...
i assumed the default value of None in userdata, but obviously,
getting userdata of bodies with no data set throw the error.

so i just set all bodies userdata to None.

works for me...
greetz
Glad you figured it out. Just to let you know, 2.0.2b1 fixes that issue (among others).

Original thread: https://box2d.org/forum/viewtopic.php?t=3139