Skip to content

Commit

Permalink
[Cherry-pick]Fix crash/freeze on systems with no AdskIdentityManager …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
zeusongit authored Mar 22, 2024
1 parent 0fc5929 commit dec5003
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions src/DynamoCore/Core/IDSDKManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Diagnostics;
using Autodesk.IDSDK;
using Dynamo.Configuration;
using Dynamo.Logging;
using DynamoServices;
using Greg;
using Greg.AuthProviders;
using RestSharp;
Expand Down Expand Up @@ -212,14 +215,14 @@ private string IDSDK_GetToken()

private bool Initialize()
{
if (Client.IsInitialized()) return true;
idsdk_status_code bRet = Client.Init();

if (Client.IsSuccess(bRet))
try
{
if (Client.IsInitialized())
if (Client.IsInitialized()) return true;
idsdk_status_code bRet = Client.Init();

if (Client.IsSuccess(bRet))
{
try
if (Client.IsInitialized())
{
IntPtr hWnd = Process.GetCurrentProcess().MainWindowHandle;
if (hWnd != null)
Expand All @@ -235,13 +238,13 @@ private bool Initialize()
return ret;
}
}
catch (Exception e)
{
return false;
}
}
return false;
}
catch (Exception)
{
return false;
}
return false;
}
private bool Deinitialize()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/DSOffice/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dec5003

Please sign in to comment.