Bug 1462882 - Avoid NPE when filtering using remote-ip; r=jryans
authorJan Odvarko <odvarko@gmail.com>
Tue, 22 May 2018 10:34:50 +0200
changeset 419457 764a847c0f3440d35f899fa4e40325df9527eb7d
parent 419456 87ceff81c3edae7f8679a10f87dd99c277bb3a19
child 419458 032d683ed7e7f201666fda75645f5d4c03325311
push id34038
push userapavel@mozilla.com
push dateWed, 23 May 2018 21:59:47 +0000
treeherdermozilla-central@366a9f1b95f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1462882
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1462882 - Avoid NPE when filtering using remote-ip; r=jryans MozReview-Commit-ID: IJ2lNgMRCYz
devtools/client/netmonitor/src/utils/filter-text-utils.js
--- a/devtools/client/netmonitor/src/utils/filter-text-utils.js
+++ b/devtools/client/netmonitor/src/utils/filter-text-utils.js
@@ -123,18 +123,18 @@ function isFlagFilterMatch(item, { type,
       let protocol = item.httpVersion;
       match = typeof protocol === "string" ?
                 protocol.toLowerCase().includes(value) : false;
       break;
     case "domain":
       match = item.urlDetails.host.toLowerCase().includes(value);
       break;
     case "remote-ip":
-      match = getFormattedIPAndPort(item.remoteAddress, item.remotePort)
-        .toLowerCase().includes(value);
+      let data = getFormattedIPAndPort(item.remoteAddress, item.remotePort);
+      match = data ? data.toLowerCase().includes(value) : false;
       break;
     case "has-response-header":
       if (typeof item.responseHeaders === "object") {
         let { headers } = item.responseHeaders;
         match = headers.findIndex(h => h.name.toLowerCase() === value) > -1;
       } else {
         match = false;
       }