aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/src/main/java/com/wireguard/config/Interface.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/com/wireguard/config/Interface.java')
-rw-r--r--app/src/main/java/com/wireguard/config/Interface.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/app/src/main/java/com/wireguard/config/Interface.java b/app/src/main/java/com/wireguard/config/Interface.java
index 0ab15a7d..b81b6d99 100644
--- a/app/src/main/java/com/wireguard/config/Interface.java
+++ b/app/src/main/java/com/wireguard/config/Interface.java
@@ -29,11 +29,19 @@ public class Interface extends BaseObservable implements Copyable<Interface>, Ob
@Override
public void copyFrom(final Interface source) {
- address = source.address;
- dns = source.dns;
- listenPort = source.listenPort;
- setPrivateKey(source.privateKey);
- mtu = source.mtu;
+ if (source != null) {
+ address = source.address;
+ dns = source.dns;
+ listenPort = source.listenPort;
+ mtu = source.mtu;
+ setPrivateKey(source.privateKey);
+ } else {
+ address = null;
+ dns = null;
+ listenPort = null;
+ mtu = null;
+ setPrivateKey(null);
+ }
}
public void generateKeypair() {