diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-03-31 00:12:10 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2023-03-31 00:12:10 +0200 |
commit | dc3b04d41d2a55b2c105a65b0d95f1b6c42706ba (patch) | |
tree | c9f2d1a725d7c4ba099c2c75fd45249cfdd7a054 /tunnel | |
parent | 0dc4f3c04ec5c90ad09daac0e591f1173f0f1bed (diff) |
tunnel: check for null sourcebuild6
Diffstat (limited to 'tunnel')
-rw-r--r-- | tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java index 9c96e00f..7b1d94fd 100644 --- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java +++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java @@ -422,7 +422,11 @@ public final class GoBackend implements Backend { } LibwgGrpc.LibwgBlockingStub stub = LibwgGrpc.newBlockingStub(channel); - DhcpRequest request = DhcpRequest.newBuilder().setSource(source).build(); + DhcpRequest.Builder requestBuilder = DhcpRequest.newBuilder(); + if (source != null) { + requestBuilder.setSource(source); + } + DhcpRequest request = requestBuilder.build(); DhcpResponse resp = stub.dhcp(request); Log.i(TAG, "Dhcp: " + resp.getError().getMessage()); |