diff --git a/common/piece.cpp b/common/piece.cpp index d2fcea76..f511f2cd 100644 --- a/common/piece.cpp +++ b/common/piece.cpp @@ -761,7 +761,11 @@ lcuint32 lcPiece::GetAllowedTransforms() const if (Section == LC_PIECE_SECTION_POSITION || Section == LC_PIECE_SECTION_INVALID) return LC_OBJECT_TRANSFORM_MOVE_X | LC_OBJECT_TRANSFORM_MOVE_Y | LC_OBJECT_TRANSFORM_MOVE_Z | LC_OBJECT_TRANSFORM_ROTATE_X | LC_OBJECT_TRANSFORM_ROTATE_Y | LC_OBJECT_TRANSFORM_ROTATE_Z; - if (mPieceInfo->GetSynthInfo()->IsCurve()) + lcSynthInfo* SynthInfo = mPieceInfo->GetSynthInfo(); + if (!SynthInfo) + return 0; + + if (SynthInfo->IsCurve()) return LC_OBJECT_TRANSFORM_MOVE_X | LC_OBJECT_TRANSFORM_MOVE_Y | LC_OBJECT_TRANSFORM_MOVE_Z | LC_OBJECT_TRANSFORM_ROTATE_X | LC_OBJECT_TRANSFORM_ROTATE_Y | LC_OBJECT_TRANSFORM_ROTATE_Z | LC_OBJECT_TRANSFORM_SCALE_X; else return LC_OBJECT_TRANSFORM_MOVE_Z; diff --git a/common/view.cpp b/common/view.cpp index 24a1381e..2a770e9c 100644 --- a/common/view.cpp +++ b/common/view.cpp @@ -745,7 +745,7 @@ void View::DrawSelectMoveOverlay() lcPiece* Piece = (lcPiece*)Focus; lcuint32 Section = Piece->GetFocusSection(); - if (Section >= LC_PIECE_SECTION_CONTROL_POINT_1 && Section <= LC_PIECE_SECTION_CONTROL_POINT_8 && Piece->mPieceInfo->GetSynthInfo()->IsCurve()) + if (Section >= LC_PIECE_SECTION_CONTROL_POINT_1 && Section <= LC_PIECE_SECTION_CONTROL_POINT_8 && Piece->mPieceInfo->GetSynthInfo() && Piece->mPieceInfo->GetSynthInfo()->IsCurve()) { int ControlPointIndex = Section - LC_PIECE_SECTION_CONTROL_POINT_1; float Strength = Piece->GetControlPoints()[ControlPointIndex].Scale; @@ -1796,7 +1796,7 @@ void View::UpdateTrackTool() lcPiece* Piece = (lcPiece*)Focus; - if (ControlPointIndex != -1 && Piece->mPieceInfo->GetSynthInfo()->IsCurve()) + if (ControlPointIndex != -1 && Piece->mPieceInfo->GetSynthInfo() && Piece->mPieceInfo->GetSynthInfo()->IsCurve()) { float Strength = Piece->GetControlPoints()[ControlPointIndex].Scale; const float ScaleStart = (2.0f - OverlayScaleRadius) * OverlayScale + Strength;