buttons were not redrawing so it was possible to use them without an active object, this crashed blender.