Skip to content
This repository was archived by the owner on Jun 8, 2024. It is now read-only.

Commit dfbd462

Browse files
committed
UI: Fix some bug
Signed-off-by: Fung Gwo <fython@163.com>
1 parent a24a01a commit dfbd462

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

mobile/src/main/kotlin/info/papdt/express/helper/model/Kuaidi100Package.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,15 @@ class Kuaidi100Package() : Parcelable {
108108
}
109109

110110
fun getLastStatusTime(): Calendar {
111-
if (data?.isNotEmpty() == true) {
112-
val dates = data!!.map {
113-
DateHelper.dateToCalendar(DEFAULT_STATUS_TIME_FORMAT.parse(it.ftime!!))
111+
try {
112+
if (data?.isNotEmpty() == true) {
113+
val dates = data!!.map {
114+
DateHelper.dateToCalendar(DEFAULT_STATUS_TIME_FORMAT.parse(it.ftime ?: it.time))
115+
}
116+
return dates.sorted().last()
114117
}
115-
return dates.sorted().last()
118+
} catch (ignored: Exception) {
119+
116120
}
117121
return Calendar.getInstance().apply { add(Calendar.YEAR, 1) }
118122
}

mobile/src/main/kotlin/info/papdt/express/helper/ui/DetailsActivity.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ class DetailsActivity : AbsActivity() {
238238
}
239239

240240
override fun onPostExecute(items: Items) {
241+
if (!this@DetailsActivity::data.isInitialized) {
242+
return
243+
}
244+
241245
mStatusBinder.setData(data)
242246
mAdapter.items = items
243247
mStatusBinder.showChiba =

0 commit comments

Comments
 (0)