Преглед на файлове

Allow URLs that don't have passwords.

pull/810/head
Chris Smith преди 6 години
родител
ревизия
b795ac39bf
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2
    1
      src/main/java/com/dmdirc/util/URIParser.java

+ 2
- 1
src/main/java/com/dmdirc/util/URIParser.java Целия файл

90
             // User info may contain special characters. When we pass individual parts to
90
             // User info may contain special characters. When we pass individual parts to
91
             // the URI constructor below, it encodes any characters not allowed in the user
91
             // the URI constructor below, it encodes any characters not allowed in the user
92
             // info. To avoid doubly-encoding them we need to decode here...
92
             // info. To avoid doubly-encoding them we need to decode here...
93
-            userInfo = URLDecoder.decode(authorityMatcher.group("auth"), "UTF-8");
93
+            String auth = authorityMatcher.group("auth");
94
+            userInfo = auth == null ? null : URLDecoder.decode(auth, "UTF-8");
94
         } catch (UnsupportedEncodingException ex) {
95
         } catch (UnsupportedEncodingException ex) {
95
             throw new InvalidURIException("Unable to create user info", ex);
96
             throw new InvalidURIException("Unable to create user info", ex);
96
         }
97
         }

Loading…
Отказ
Запис