mirror of https://github.com/M66B/FairEmail.git
parent
b45ef948b3
commit
a271d66992
|
@ -1635,8 +1635,7 @@ public abstract class DB extends RoomDatabase {
|
|||
|
||||
@TypeConverter
|
||||
public static Address[] decodeAddresses(String json) {
|
||||
try {
|
||||
if (TextUtils.isEmpty(json))
|
||||
if (json == null)
|
||||
return null;
|
||||
else if (json.startsWith("[[")) {
|
||||
// [[{"address":"...","personal":"..."}],[{... ...}]]
|
||||
|
@ -1650,10 +1649,6 @@ public abstract class DB extends RoomDatabase {
|
|||
// [{"address":"...","personal":"..."}]
|
||||
return new Address[]{InternetAddressJson.from(json.substring(2, json.length() - 2))};
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public class InternetAddressJson extends InternetAddress {
|
|||
if (this.json != null) {
|
||||
try {
|
||||
JSONObject jaddress = new JSONObject("{" + this.json + "}");
|
||||
String address = jaddress.optString("address");
|
||||
String address = jaddress.getString("address");
|
||||
String personal = jaddress.optString("personal");
|
||||
if (!TextUtils.isEmpty(address))
|
||||
super.setAddress(address);
|
||||
|
|
Loading…
Reference in New Issue