From 9e509016645fe497d1f462b8ab54d10e770e45b7 Mon Sep 17 00:00:00 2001 From: Schoumi Date: Fri, 4 Aug 2017 23:47:59 +0200 Subject: [PATCH] Fix missing / at end of url Fixes #2 --- app/src/main/java/fr/mobdev/lpcprog/dialog/ServerDialog.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/fr/mobdev/lpcprog/dialog/ServerDialog.java b/app/src/main/java/fr/mobdev/lpcprog/dialog/ServerDialog.java index 6a267e7..3f9d1df 100644 --- a/app/src/main/java/fr/mobdev/lpcprog/dialog/ServerDialog.java +++ b/app/src/main/java/fr/mobdev/lpcprog/dialog/ServerDialog.java @@ -67,6 +67,10 @@ public class ServerDialog extends DialogFragment { EditText urlText = (EditText) view.findViewById(R.id.url_text); if(urlText.getText().length() > 0) url += urlText.getText(); + else + return; + if(!url.endsWith("/")) + url += "/"; //add server to database DatabaseManager.getInstance(getActivity().getApplicationContext()).addServer(url); listener.updateServerList();