[APM] Treat error.exception.stacktrace.line as optional (#55733)
This commit is contained in:
parent
6beb2b2c06
commit
b39076e2bd
|
@ -34,7 +34,7 @@ const FrameHeading: React.FC<Props> = ({ stackframe, isLibraryFrame }) => {
|
|||
const FileDetail = isLibraryFrame
|
||||
? LibraryFrameFileDetail
|
||||
: AppFrameFileDetail;
|
||||
const lineNumber = stackframe.line.number;
|
||||
const lineNumber = stackframe.line?.number ?? 0;
|
||||
|
||||
const name =
|
||||
'filename' in stackframe ? stackframe.filename : stackframe.classname;
|
||||
|
@ -46,7 +46,7 @@ const FrameHeading: React.FC<Props> = ({ stackframe, isLibraryFrame }) => {
|
|||
{lineNumber > 0 && (
|
||||
<Fragment>
|
||||
{' at '}
|
||||
<FileDetail>line {stackframe.line.number}</FileDetail>
|
||||
<FileDetail>line {lineNumber}</FileDetail>
|
||||
</Fragment>
|
||||
)}
|
||||
</FileDetails>
|
||||
|
|
|
@ -77,5 +77,5 @@ export function Stackframe({
|
|||
function hasLineContext(
|
||||
stackframe: IStackframe
|
||||
): stackframe is IStackframeWithLineContext {
|
||||
return stackframe.line.hasOwnProperty('context');
|
||||
return stackframe.line?.hasOwnProperty('context') || false;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ type IStackframeBase = {
|
|||
vars?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
line: {
|
||||
line?: {
|
||||
number: number;
|
||||
};
|
||||
} & ({ classname: string } | { filename: string });
|
||||
|
|
Loading…
Reference in a new issue