Skip to content

Commit c96667e

Browse files
committed
Fix contract violation on code that never executes
1 parent e4908dc commit c96667e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/org/xbill/DNS/SVCBBase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,8 @@ public String toString() {
564564
InetAddress addr = InetAddress.getByAddress(null, b);
565565
sb.append(addr.getHostAddress());
566566
} catch (UnknownHostException e) {
567-
return null;
567+
// should not happen, but returning null and throwing is bad
568+
return e.getMessage();
568569
}
569570
}
570571
return sb.toString();

0 commit comments

Comments
 (0)