Skip to content

Commit 3b502ac

Browse files
committed
fix bootstrap test (ignore multiaddresses we can't parse)
1 parent 3cdefc0 commit 3b502ac

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/io/ipfs/api/IPFS.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,15 @@ public Map ls(Multihash path) throws IOException {
423423
// Network commands
424424

425425
public List<MultiAddress> bootstrap() throws IOException {
426-
return ((List<String>)retrieveMap("bootstrap/").get("Peers")).stream().map(x -> new MultiAddress(x)).collect(Collectors.toList());
426+
return ((List<String>)retrieveMap("bootstrap/").get("Peers"))
427+
.stream()
428+
.flatMap(x -> {
429+
try {
430+
return Stream.of(new MultiAddress(x));
431+
} catch (Exception e) {
432+
return Stream.empty();
433+
}
434+
}).collect(Collectors.toList());
427435
}
428436

429437
public class Bootstrap {

0 commit comments

Comments
 (0)