Commit 368b562b authored by zhaogang's avatar zhaogang
Browse files

Bug 1578755 - Fix a guarding condition for jumping to prettified tab correctly.r=davidwalsh

In previous code, the selectedLocation can be a non-empty object containing a line number of 0, which will cause the sourceMap to complain and halt the jumping procedure. I added a check to make sure that the sourceMap branch is only executed when the selectedLocation makes sense.

Differential Revision: https://phabricator.services.mozilla.com/D48290

--HG--
extra : moz-landing-system : lando
parent e3df19af
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ function selectPrettyLocation(cx: Context, prettySource: Source) {
  return async ({ dispatch, sourceMaps, getState }: ThunkArgs) => {
    let location = getSelectedLocation(getState());

    if (location) {
    if (location && location.line >= 1) {
      location = await sourceMaps.getOriginalLocation(location);
      return dispatch(
        selectSpecificLocation(cx, { ...location, sourceId: prettySource.id })