From c5693dfa356f36d53f319af741b25cf04b0e0b89 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Sat, 30 Jul 2011 17:09:09 +0400 Subject: [PATCH] Fix crash when UI Automation interface in absent in system --- wordbyauto.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wordbyauto.cc b/wordbyauto.cc index 4d31d04e..4e8490e0 100644 --- a/wordbyauto.cc +++ b/wordbyauto.cc @@ -28,7 +28,8 @@ HRESULT hr; hr = CoCreateInstance( CLSID_CUIAutomation , NULL, CLSCTX_INPROC_SERVER, IID_IUIAutomation, (void**)&pGDAutomation ); if( hr != S_OK ) pGDAutomation = NULL; pTree = NULL; - hr = pGDAutomation->get_RawViewWalker( &pTree ); + if( pGDAutomation != NULL ) + hr = pGDAutomation->get_RawViewWalker( &pTree ); memset( buffer, 0, sizeof(buffer) ); }