Bug 1398893 - clean pending breakpoints if debugger in corrupted state;r=jdescottes
authorJason Laster <jason.laster.11@gmail.com>
Tue, 12 Sep 2017 14:43:31 +0200
changeset 663382 adc30ee91284e7d4ab9393a53d27eb5f489cc97b
parent 663381 b507473b9b75dfcf08e4529483583a169f598ff6
child 663383 e62cc9325a2b6124cda2a1e219a66fe161ca353b
push id79424
push userbmo:tchiovoloni@mozilla.com
push dateTue, 12 Sep 2017 23:17:54 +0000
reviewersjdescottes
bugs1398893
milestone57.0a1
Bug 1398893 - clean pending breakpoints if debugger in corrupted state;r=jdescottes MozReview-Commit-ID: K2bYS6RgbBK
devtools/client/debugger/new/debugger.js
--- a/devtools/client/debugger/new/debugger.js
+++ b/devtools/client/debugger/new/debugger.js
@@ -43153,16 +43153,21 @@ function updateBreakpoint(state, action)
   return state.setIn(["pendingBreakpoints", locationId], pendingBreakpoint);
 }
 
 function removeBreakpoint(state, action) {
   var breakpoint = action.breakpoint;
 
   var locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location);
 
+  const pendingBp = state.getIn(["pendingBreakpoints", locationId]);
+  if (!pendingBp) {
+    return state.set("pendingBreakpoints", I.Map());
+  }
+
   return state.deleteIn(["pendingBreakpoints", locationId]);
 }
 
 // Selectors
 // TODO: these functions should be moved out of the reducer
 
 function getPendingBreakpoints(state) {
   return state.pendingBreakpoints.pendingBreakpoints;
@@ -46383,9 +46388,9 @@ exports.default = (0, _reactRedux.connec
 /* 1173 */,
 /* 1174 */
 /***/ (function(module, exports) {
 
 module.exports = "<svg xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 400\" xml:space=\"preserve\" id=\"svg2\" version=\"1.1\"><metadata id=\"metadata8\"><rdf:RDF><cc:Work rdf:about><dc:format>image/svg+xml</dc:format><dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"></dc></cc:Work></rdf:RDF></metadata><defs id=\"defs6\"></defs><g transform=\"matrix(1.3333333,0,0,-1.3333333,0,400)\" id=\"g10\"><g transform=\"translate(178.0626,235.0086)\" id=\"g12\"><path id=\"path14\" style=\"fill:#41b883;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M 0,0 -22.669,-39.264 -45.338,0 h -75.491 L -22.669,-170.017 75.491,0 Z\"></path></g><g transform=\"translate(178.0626,235.0086)\" id=\"g16\"><path id=\"path18\" style=\"fill:#34495e;fill-opacity:1;fill-rule:nonzero;stroke:none\" d=\"M 0,0 -22.669,-39.264 -45.338,0 H -81.565 L -22.669,-102.01 36.227,0 Z\"></path></g></g></svg>"
 
 /***/ })
 /******/ ]);
-});
\ No newline at end of file
+});