Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] [APM] Treat error.exception.stacktrace.line as optional (#55733) #55840

Merged
merged 2 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type IStackframeBase = {
vars?: {
[key: string]: unknown;
};
line: {
line?: {
number: number;
};
} & ({ classname: string } | { filename: string });
Expand Down