Skip to content

Commit dec5003

Browse files
authored
[Cherry-pick]Fix crash/freeze on systems with no AdskIdentityManager or any adsk product (#15042) (#15048)
* Fix crash/freeze on systems with no AdskIdentityManager or any adsk product (#15042) * Update IDSDKManager.cs * Update IDSDKManager.cs * add logs * revert resource designer ver * remove logs from cherrypick
1 parent 0fc5929 commit dec5003

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/DynamoCore/Core/IDSDKManager.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
using System;
22
using System.Diagnostics;
33
using Autodesk.IDSDK;
4+
using Dynamo.Configuration;
5+
using Dynamo.Logging;
6+
using DynamoServices;
47
using Greg;
58
using Greg.AuthProviders;
69
using RestSharp;
@@ -212,14 +215,14 @@ private string IDSDK_GetToken()
212215

213216
private bool Initialize()
214217
{
215-
if (Client.IsInitialized()) return true;
216-
idsdk_status_code bRet = Client.Init();
217-
218-
if (Client.IsSuccess(bRet))
218+
try
219219
{
220-
if (Client.IsInitialized())
220+
if (Client.IsInitialized()) return true;
221+
idsdk_status_code bRet = Client.Init();
222+
223+
if (Client.IsSuccess(bRet))
221224
{
222-
try
225+
if (Client.IsInitialized())
223226
{
224227
IntPtr hWnd = Process.GetCurrentProcess().MainWindowHandle;
225228
if (hWnd != null)
@@ -235,13 +238,13 @@ private bool Initialize()
235238
return ret;
236239
}
237240
}
238-
catch (Exception e)
239-
{
240-
return false;
241-
}
242241
}
242+
return false;
243+
}
244+
catch (Exception)
245+
{
246+
return false;
243247
}
244-
return false;
245248
}
246249
private bool Deinitialize()
247250
{

src/Libraries/DSOffice/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)