This repository was archived by the owner on Apr 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,11 @@ class Commit extends Proposal {
182182 } else if ( targets ) {
183183 logger . debug ( '%s - sending to the targets' , method ) ;
184184 const committers = this . channel . getTargetCommitters ( targets ) ;
185+
186+ if ( committers . length === 0 ) {
187+ throw new Error ( 'Unable to find any target committers' ) ;
188+ }
189+
185190 let result ;
186191 for ( const committer of committers ) {
187192 const isConnected = await committer . checkConnection ( ) ;
Original file line number Diff line number Diff line change @@ -106,6 +106,14 @@ describe('Commit', () => {
106106 } ) ;
107107
108108 describe ( '#send' , ( ) => {
109+ it ( 'throws if targets committers is missing' , async ( ) => {
110+ commit . build ( idx ) ;
111+ const request = {
112+ targets : [ ]
113+ } ;
114+ await commit . sign ( idx ) ;
115+ await commit . send ( request ) . should . be . rejectedWith ( 'Unable to find any target committers' ) ;
116+ } ) ;
109117 it ( 'throws if targets is missing' , async ( ) => {
110118 endorsement . _proposalResponses = [ ] ;
111119 endorsement . _proposalResponses . push ( proposalResponse ) ;
You can’t perform that action at this time.
0 commit comments