Closed Bug 1333383 Opened 7 years ago Closed 7 years ago

netmonitor response panel is empty if a value is null


(DevTools :: Netmonitor, defect, P2)

53 Branch


(firefox53 fixed, firefox54 verified)

Firefox 54
Tracking Status
firefox53 --- fixed
firefox54 --- verified


(Reporter: jdescottes, Assigned: kausam2015, Mentored)



(Keywords: good-first-bug)


(3 files, 1 obsolete file)

- open devtools, open netmonitor
- go to
- in the requests list, click on experiments.json
- open the Response tab 

AR: Response tab is empty
ER: Response tab should show the json preview

This json contains some values that are "null" which crashes the properties-view component.

A more isolated test case is at . The json is just

> { "results": [{ "nullstring": null }] }

The issue comes from

> typeof member.value === "object" && member.value.value

When member is null the first check passes and the second one crashes. Guarding with member.value && member.value.value should be good enough here.

Adding a new mochitest could be nice though! I think it should be straightforward to add one similar to devtools/client/netmonitor/test/browser_net_json-*
Has STR: --- → yes
Priority: -- → P2
I would like to work on this bug.
Thanks Cosm! Assigned to you.

Some links to get started with devtools development:

I gave a few hints for the fix in the summary. Let me know if you have any issue reproducing the bug or implementing the fix.

If you breeze through the fix, and want to try adding a test, try to add a new one, similar to devtools/client/netmonitor/test/browser_net_json-long.js

To run a test you can use the command `./mach test {name}`, for instance:
> ./mach test devtools/client/netmonitor/test/browser_net_json-long.js

When adding a new test, you must reference it in the browser.ini file located in the same directory as your test.
Assignee: nobody → kausam2015
STRs screen recording
Attached patch proposed patchSplinter Review
Attachment #8831097 - Flags: review?(jdescottes)
Attachment #8831097 - Attachment is patch: true
Comment on attachment 8831097 [details] [diff] [review]
proposed patch

Review of attachment 8831097 [details] [diff] [review]:

Thanks for the patch Cosm, looks good!

I have submitted your changeset on our continuous integration platform. This will run our test suite to make sure this change doesn't introduce obvious regressions.
The results will be displayed on

If the tests are ok ("try is green") we will mark your patch as checkin-needed and a sheriff will pick it up and land it on an integration branch. In the meantime I will try to add a new mochitest to make sure we don't regress your fix in the future.
Attachment #8831097 - Flags: review?(jdescottes) → review+
Attached patch bug1333383.test.patch (obsolete) — Splinter Review
Honza: here's a mochitest to go together with the patch from Cosm. Try run at
Attachment #8831237 - Flags: review?(odvarko)
Attachment #8831237 - Attachment is obsolete: true
Attachment #8831237 - Flags: review?(odvarko)
Attachment #8831417 - Flags: review?(odvarko)
Comment on attachment 8831417 [details] [diff] [review]

Review of attachment 8831417 [details] [diff] [review]:

Looks good, thanks for working on this!



::: devtools/client/netmonitor/test/html_json-basic.html
@@ +11,5 @@
> +    <title>Network Monitor test page</title>
> +  </head>
> +
> +  <body>
> +    <p>JSON resquest test page</p>

typo: resquest -> request
Attachment #8831417 - Flags: review?(odvarko) → review+
Pushed by
fix netmonitor response tab for json responses with null values;r=jdescottes
add test for netmonitor rendering JSON response with null;r=honza
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
Comment on attachment 8831097 [details] [diff] [review]
proposed patch

Approval Request Comment
[Feature/Bug causing the regression]:

[User impact if declined]: the Response tab in Netmonitor is empty when viewing JSON responses containing the value 'null'. Several duplicates have been recently filed for this so it looks like the issue is pretty frequently spotted

[Is this code covered by automated tests?]: Tests have been added in a separate patch (attachment 8831417 [details] [diff] [review]). They can't be easily ported to aurora.

[Has the fix been verified in Nightly?]: It's been in nightly for a few days and other bugs have been confirmed as solved as a duplicate of this one.

[Needs manual test from QE? If yes, steps to reproduce]: 
- open devtools, open netmonitor
- go to
- in the netmonitor requests list, click on experiments.json
- open the netmonitor response tab 

[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: No
[Why is the change risky/not risky?]: Just guarding against a null value
[String changes made/needed]: N/A
Attachment #8831097 - Flags: approval-mozilla-aurora?
Hi Rares,
could you help find someone to verify if this issue is fixed as expected on a latest Nightly build? Thanks!
Flags: needinfo?(rares.bologa)
Flags: needinfo?(rares.bologa) → needinfo?(roxana.leitan)
Verified as fixed using the latest Nightly 54.0a1 (2017-02-07) on Windows 10 x64, Ubuntu 16.04 and Mac OS X 10.11.
Flags: needinfo?(roxana.leitan)
Comment on attachment 8831097 [details] [diff] [review]
proposed patch

Fix the issue in netmonitor response panel if a value is null and was verified. Aurora53+.
Attachment #8831097 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
I verified that Aurora (FirefoxDeveloperEdition-53.0a2, 2017-02-10) works again.
I verified this bug
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.