@itwin/core-frontend 5.8.0-dev.13 → 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.
@@ -1408,7 +1408,12 @@ class ToolAdmin {
1408
1408
  await this.setPrimitiveTool(newTool);
1409
1409
  }
1410
1410
  // it is important to raise event after setPrimitiveTool is called
1411
- this.onActiveToolChanged(undefined !== newTool ? newTool : this.idleTool, StartOrResume.Start);
1411
+ const activeTool = newTool ?? this._idleTool;
1412
+ // _idleTool is cleared during onShutDown(); skip the event if shutdown has already run
1413
+ // to avoid emitting activeToolChanged with an undefined tool.
1414
+ if (undefined === activeTool)
1415
+ return;
1416
+ this.onActiveToolChanged(activeTool, StartOrResume.Start);
1412
1417
  }
1413
1418
  finally {
1414
1419
  if (resolveStarting)