diff options
author | Samuel Holland <samuel@sholland.org> | 2017-08-17 03:32:01 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-08-17 03:32:01 -0500 |
commit | c2189a78b9dafc237afd3de5f9fc66bc1567eb15 (patch) | |
tree | 765b8b1e5b5c653786f9a7e16b1888a48bbfb930 /app/src/main/java/com/wireguard/android | |
parent | cb48a7be3a0b30c50aed7bf5f7552aec33ce7ab2 (diff) |
ConfigEditFragment: Add extremely basic validation
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/android')
-rw-r--r-- | app/src/main/java/com/wireguard/android/ConfigEditFragment.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/android/ConfigEditFragment.java b/app/src/main/java/com/wireguard/android/ConfigEditFragment.java index 7cbcfddd..384aadef 100644 --- a/app/src/main/java/com/wireguard/android/ConfigEditFragment.java +++ b/app/src/main/java/com/wireguard/android/ConfigEditFragment.java @@ -73,7 +73,11 @@ public class ConfigEditFragment extends BaseConfigFragment { } private void saveConfig() { - // FIXME: validate input + final String errorMessage = localConfig.validate(); + if (errorMessage != null) { + Toast.makeText(getActivity(), errorMessage, Toast.LENGTH_SHORT).show(); + return; + } try { if (getCurrentConfig() != null) VpnService.getInstance().update(getCurrentConfig().getName(), localConfig); |