Skip to content

Commit

Permalink
Fix global.__fetchSegment's error case (facebook#46854)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#46854

When segment fetch fails, it seems incorrect to call the callback twice: once with error, and once with null.

This seems like a bug.

Created from CodeHub with https://fburl.com/edit-in-codehub

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D63959015

fbshipit-source-id: f3ebb0f4732d99d91b5717a5bf193f44d957bde4
  • Loading branch information
RSNara authored and facebook-github-bot committed Oct 6, 2024
1 parent 352c063 commit d0912ed
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function __fetchSegment(
const error = new Error(errorObject.message);
(error: any).code = errorObject.code; // flowlint-line unclear-type: off
callback(error);
return;
}

callback(null);
Expand Down

0 comments on commit d0912ed

Please sign in to comment.