From 6331395a892cbdb38c8262fbb89f2d42d156d561 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 15 Jun 2018 10:27:35 -0700 Subject: [PATCH] remove crash mode in invokable methods --- libraries/animation/src/AnimationCache.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libraries/animation/src/AnimationCache.cpp b/libraries/animation/src/AnimationCache.cpp index 9aa315beb8..f30d5605d7 100644 --- a/libraries/animation/src/AnimationCache.cpp +++ b/libraries/animation/src/AnimationCache.cpp @@ -105,8 +105,10 @@ QStringList Animation::getJointNames() const { return result; } QStringList names; - foreach (const FBXJoint& joint, _geometry->joints) { - names.append(joint.name); + if (_geometry) { + foreach (const FBXJoint& joint, _geometry->joints) { + names.append(joint.name); + } } return names; } @@ -114,11 +116,15 @@ QStringList Animation::getJointNames() const { QVector Animation::getFrames() const { if (QThread::currentThread() != thread()) { QVector result; - BLOCKING_INVOKE_METHOD(const_cast(this), "getFrames", + BLOCKING_INVOKE_METHOD(const_cast(this), "getFrames", Q_RETURN_ARG(QVector, result)); return result; } - return _geometry->animationFrames; + if (_geometry) { + return _geometry->animationFrames; + } else { + return QVector(); + } } const QVector& Animation::getFramesReference() const {