python console autocomplete would crash (missing NULL check for pose channels)

add rna functions id.animation_data_create() and id.animation_data_clear() - works for all ID types that support animdata.
This commit is contained in:
2009-11-05 10:50:58 +00:00
parent 06d5d53a24
commit cacd68c335
2 changed files with 12 additions and 2 deletions

View File

@@ -196,7 +196,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
bArmature *arm= (obact) ? obact->data : NULL;
bPoseChannel *pchan;
if (obact && arm) {
if (obact && obact->pose && arm) {
for (pchan= obact->pose->chanbase.first; pchan; pchan= pchan->next) {
/* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */
if ((pchan->bone) && (arm->layer & pchan->bone->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {
@@ -211,7 +211,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
bArmature *arm= (obact) ? obact->data : NULL;
bPoseChannel *pchan;
if (obact && arm) {
if (obact && obact->pose && arm) {
for (pchan= obact->pose->chanbase.first; pchan; pchan= pchan->next) {
/* ensure that PoseChannel is on visible layer and is not hidden in PoseMode */
if ((pchan->bone) && (arm->layer & pchan->bone->layer) && !(pchan->bone->flag & BONE_HIDDEN_P)) {