From 827b00226e946c12d1e765ffae10794e92daee27 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sun, 18 Jul 2010 21:16:40 +0000 Subject: [PATCH] Fix 3029892: assimpview crashes if the animation slider is touched while no asset is loaded. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@786 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- tools/assimp_view/MessageProc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/assimp_view/MessageProc.cpp b/tools/assimp_view/MessageProc.cpp index 84e731506..5bd541c91 100644 --- a/tools/assimp_view/MessageProc.cpp +++ b/tools/assimp_view/MessageProc.cpp @@ -1262,7 +1262,8 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, case WM_HSCROLL: - if (GetDlgItem(g_hDlg, IDC_SLIDERANIM) == (HWND)lParam) + // XXX quick and dirty fix for #3029892 + if (GetDlgItem(g_hDlg, IDC_SLIDERANIM) == (HWND)lParam && g_pcAsset && g_pcAsset->pcScene->mAnimations) { double num = (double)SendDlgItemMessage(g_hDlg,IDC_SLIDERANIM,TBM_GETPOS,0,0); const aiAnimation* anim = g_pcAsset->pcScene->mAnimations[ g_pcAsset->mAnimator->CurrentAnimIndex() ];