ConfigEditFragment: Add extremely basic validation
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -127,4 +127,12 @@ public class Config extends BaseObservable
|
||||
sb.append('\n').append(peer);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String validate() {
|
||||
if (name == null || !isNameValid(name))
|
||||
return "This configuration does not have a valid name.";
|
||||
if (iface.getPublicKey() == null)
|
||||
return "This configuration does not have a valid keypair.";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user