Skip to content

Commit

Permalink
fix: 修复版本号返回为空导致的崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
xz-dev committed Jan 7, 2022
1 parent eb2a0d2 commit 5a35203
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "net.xzos.upgradeall"
minSdkVersion 21
targetSdkVersion 31
versionCode 90
versionName "0.11"
versionCode 91
versionName "0.11-rc.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
kapt {
arguments {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.google.gson.annotations.SerializedName

data class ReleaseGson(
@SerializedName("version_number") val versionNumber: String,
@SerializedName("change_log") val changelog: String,
@SerializedName("change_log") val changelog: String?,
@SerializedName("assets") val assetList: List<Assets>,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ internal class DataGetter(private val dataStorage: DataStorage) {
)
}
)
assetsList.add(asset)
asset?.apply { assetsList.add(this) }
}
dataStorage.versionData.addAsset(assetsList, hub.uuid)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ class Asset private constructor(
)

fun newInstance(
versionNumber: String, hub: Hub, changelog: String?,
versionNumber: String?, hub: Hub, changelog: String?,
_fileAssetList: List<TmpFileAsset>
): Asset {
): Asset? {
if (versionNumber == null) return null
val fileAssetList: List<FileAsset> = _fileAssetList.map {
FileAsset(it.name, it.downloadUrl, it.fileType, it.assetIndex, hub)
}
Expand Down

0 comments on commit 5a35203

Please sign in to comment.