Skip to content

Commit

Permalink
Enforce bpg action fields argument type is an object/dict
Browse files Browse the repository at this point in the history
Summary:
If you pass a string, no error is throw, and no action is taken, causing a bit of confusion for users (such as cts)

refs T21563

Test Plan: npm linked to test manually

Reviewers: sbahra, jpihlaja, ahicks

Reviewed By: jpihlaja, ahicks

Maniphest Tasks: T21563

Differential Revision: https://hack.in.backtrace.io/D5369
  • Loading branch information
Jacob Shufro committed Jun 27, 2022
1 parent 3db270d commit a6a678d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/bpg.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ class BPG {
throw Error('unknown action');
}

if (typeof fields != 'object')
throw Error('fields must be a dict')
/*
* Construct key object from parent, otherwise construct from
* child.
Expand Down

0 comments on commit a6a678d

Please sign in to comment.