@itwin/core-frontend 5.8.0-dev.12 → 5.8.0-dev.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1401,7 +1401,12 @@ export class ToolAdmin {
1401
1401
  await this.setPrimitiveTool(newTool);
1402
1402
  }
1403
1403
  // it is important to raise event after setPrimitiveTool is called
1404
- this.onActiveToolChanged(undefined !== newTool ? newTool : this.idleTool, StartOrResume.Start);
1404
+ const activeTool = newTool ?? this._idleTool;
1405
+ // _idleTool is cleared during onShutDown(); skip the event if shutdown has already run
1406
+ // to avoid emitting activeToolChanged with an undefined tool.
1407
+ if (undefined === activeTool)
1408
+ return;
1409
+ this.onActiveToolChanged(activeTool, StartOrResume.Start);
1405
1410
  }
1406
1411
  finally {
1407
1412
  if (resolveStarting)