Skip to content

Commit

Permalink
[main] use helper func to get window #2178
Browse files Browse the repository at this point in the history
  • Loading branch information
siyuniu-ms authored Oct 17, 2023
1 parent c09995a commit 38a5bad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shared/AppInsightsCommon/src/Telemetry/Exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import {
IDiagnosticLogger, arrForEach, arrMap, isArray, isError, isFunction, isNullOrUndefined, isObject, isString, strTrim
} from "@microsoft/applicationinsights-core-js";
import { strIndexOf } from "@nevware21/ts-utils";
import { getWindow, strIndexOf } from "@nevware21/ts-utils";
import { strNotSpecified } from "../Constants";
import { FieldType } from "../Enums";
import { IExceptionData } from "../Interfaces/Contracts/IExceptionData";
Expand Down Expand Up @@ -156,7 +156,7 @@ function _getStackFromErrorObj(errorObj:any): IStackDetails {
details = errorObj;
} else if (_isStackDetails(errorObj[strStackDetails])) {
details = errorObj[strStackDetails];
} else if (window && window["opera"] && errorObj[strMessage]) {
} else if (getWindow() && getWindow()["opera"] && errorObj[strMessage]) {
// Opera
details = _getOperaStack(errorObj.message);
} else if (errorObj["reason"] && errorObj.reason[strStack]) {
Expand Down

0 comments on commit 38a5bad

Please sign in to comment.