Skip to content

Commit 0e9ddcc

Browse files
committed
catch error better
1 parent a7d1ac6 commit 0e9ddcc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/nocapd/src/daemon.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,11 @@ const populateRelays = async ( skipJob = false ) => {
222222
log.debug(`populateRelays(): begin`)
223223

224224
const { Relay } = Schemas
225-
const syncData = await bootstrap('nocapd').catch( () => log.warn('bootstrap() failed') )
225+
const syncData = await bootstrap('nocapd').catch( () => log.warn('bootstrap() failed') );
226+
227+
if(!syncData?.[0]) return log.error(`populateRelays(): no relays found in bootstrap data`)
226228

227-
log.debug(`populateRelays(): found ${syncData[0].length} *maybe new* relays`)
229+
log.debug(`populateRelays(): found ${syncData?.[0].length} *maybe new* relays`)
228230

229231
const relays = syncData[0].map( url => new Relay({ url }) )
230232

0 commit comments

Comments
 (0)