Small improvement

pull/160/head
M66B 5 years ago
parent ef56231855
commit 228e6b4dc9

@ -1075,13 +1075,12 @@ public abstract class DB extends RoomDatabase {
} }
for (int i = 0; i < jaddresses.length(); i++) { for (int i = 0; i < jaddresses.length(); i++) {
JSONObject jaddress = (JSONObject) jaddresses.get(i); JSONObject jaddress = (JSONObject) jaddresses.get(i);
if (jaddress.has("personal")) String email = jaddress.getString("address");
result.add(new InternetAddress( String personal = jaddress.optString("personal");
jaddress.getString("address"), if (TextUtils.isEmpty(personal))
jaddress.getString("personal"))); result.add(new InternetAddress(email));
else else
result.add(new InternetAddress( result.add(new InternetAddress(email, personal));
jaddress.getString("address")));
} }
} catch (Throwable ex) { } catch (Throwable ex) {
// Compose can store invalid addresses // Compose can store invalid addresses

Loading…
Cancel
Save