]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Throw an exception if UUID can't get parsed
authorTobias Brunner <tobias@strongswan.org>
Mon, 19 Oct 2020 15:52:15 +0000 (17:52 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 29 Oct 2020 09:57:07 +0000 (10:57 +0100)
The parser is quite picky and e.g. doesn't accept UUIDs without dashes.
Even without a specific error, this at least points the users into the
right direction.

Fixes #3583.

src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileImportActivity.java

index a9c8b56de75162321d055ea264848e1691d8a791..12e77eeb2c98adacb82b2642da7a68a9cfba01fb 100644 (file)
@@ -463,8 +463,7 @@ public class VpnProfileImportActivity extends AppCompatActivity
                }
                catch (IllegalArgumentException e)
                {
-                       e.printStackTrace();
-                       return null;
+                       throw new JSONException(getString(R.string.profile_import_failed_value, "uuid"));
                }
                ParsedVpnProfile profile = new ParsedVpnProfile();
                Integer flags = 0;