Skip to content

Commit

Permalink
Avoid NPE in debugPrint() when owner is null
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 414390111
  • Loading branch information
larsrc-google authored and copybara-github committed Dec 6, 2021
1 parent 402e80e commit bcb45ef
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,11 @@ public Sequence<Linkstamp> getLinkstampsForStarlark() {
@Override
public void debugPrint(Printer printer) {
printer.append("<LinkerInput(owner=");
owner.debugPrint(printer);
if (owner == null) {
printer.append("[null owner, uses old create_linking_context API]");
} else {
owner.debugPrint(printer);
}
printer.append(", libraries=[");
for (LibraryToLink libraryToLink : libraries) {
libraryToLink.debugPrint(printer);
Expand Down

0 comments on commit bcb45ef

Please sign in to comment.