--- a/devtools/client/debugger/new/src/reducers/sources.js+++ b/devtools/client/debugger/new/src/reducers/sources.js@@ -174,16 +174,25 @@ function update( } /* * Update a source when its state changes * e.g. the text was loaded, it was blackboxed */ function updateSource(state: SourcesState, source: Object) { const existingSource = state.sources[source.id];++ // If there is no existing version of the source, it means that we probably+ // ended up here as a result of an async action, and the sources were cleared+ // between the action starting and the source being updated.+ if (!existingSource) {+ // TODO: We may want to consider throwing here once we have a better+ // handle on async action flow control.+ return state;+ } return { ...state, sources: { ...state.sources, [source.id]: { ...existingSource, ...source } } }; }