profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Null checks to handle Missing unified string optional values

Open itsarijitray opened this issue 1 year ago • 3 comments

Fixes: https://github.com/firefox-devtools/profiler/issues/5109

Adding null check in the if statement so that it enters the if-block only if value field is defined and not empty.

Screenshot 2024-09-14 at 7 26 57 PM

itsarijitray avatar Sep 14 '24 13:09 itsarijitray

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.40%. Comparing base (7562508) to head (f5fac1b). Report is 137 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5125   +/-   ##
=======================================
  Coverage   88.40%   88.40%           
=======================================
  Files         305      305           
  Lines       27716    27716           
  Branches     7514     7514           
=======================================
  Hits        24501    24501           
  Misses       2981     2981           
  Partials      234      234           
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 14 '24 13:09 codecov[bot]

@fqueze @julienw

itsarijitray avatar Sep 14 '24 13:09 itsarijitray

You can easily add some test code in this existing test: https://github.com/firefox-devtools/profiler/blob/756250859908d5fd480b09c0498b7f2cc97b178c/src/test/store/profile-view.test.js#L906 You could simply add a marker of the same "type" without any of the other properties, and otherwise don't touch anything else (because that marker wouldn't be found anyway). This would ensure that this doesn't throw in the process.

julienw avatar Sep 19 '24 11:09 julienw

superceded by #5192

julienw avatar Nov 18 '24 14:11 julienw