Closed Bug 1739937 Opened 4 years ago Closed 4 years ago

Unexpected exception TypeError: can't access property "endsWith", marker.data.filename is undefined at Z:/task_1636322741/build/tests/xpcshell/tests/tools/profiler/tests/xpcshell/head.js:131

Categories

(Core :: Gecko Profiler, defect, P3)

defect

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

Details

Attachments

(1 file)

I've seen this happen in this Try, log.

The test marker.data?.filename.endsWith(filename) assumes that there is always a "filename" field in a "FileIO" marker, but it's not true if the IOInterposer could not retrieve a filename.
So the test should really be marker.data?.filename?.endsWith(filename), note the added ? after filename.

Severity: -- → S4

If the IOInterposer cannot retrieve a filename, the "filename" property is not even written in the marker "data" payload. So its presence should be checked before trying to use JS string functions on it.

Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d228d29a68be "FileIO" markers may be missing the "filename" property - r=canaltinova

I checked that in the frontend types, we properly marked this property as optional.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch

(In reply to Julien Wajsberg [:julienw] from comment #3)

I checked that in the frontend types, we properly marked this property as optional.

Good idea, thank you for checking.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: