mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 21:16:30 +02:00
Fix disgusting getNewLoc call (!! already checks null!!)
This commit is contained in:
parent
a0da889a02
commit
1d2ec61232
@ -126,7 +126,6 @@ class UpdateManager internal constructor(private val opts: Options, val ui: IUse
|
|||||||
|
|
||||||
ui.submitProgress(InstallProgress("Loading pack file..."))
|
ui.submitProgress(InstallProgress("Loading pack file..."))
|
||||||
val packFileSource = try {
|
val packFileSource = try {
|
||||||
Objects.requireNonNull(opts.downloadURI)
|
|
||||||
val src = getFileSource(opts.downloadURI!!)
|
val src = getFileSource(opts.downloadURI!!)
|
||||||
getHasher("sha256").getHashingSource(src)
|
getHasher("sha256").getHashingSource(src)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@ -191,12 +190,16 @@ class UpdateManager internal constructor(private val opts: Options, val ui: IUse
|
|||||||
handleCancellation()
|
handleCancellation()
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// This is badly written, I'll probably heavily refactor it at some point
|
val index = pf.index!!
|
||||||
// The port to Kotlin made this REALLY messy!!!!
|
getNewLoc(opts.downloadURI, index.file)?.let { newLoc ->
|
||||||
getNewLoc(opts.downloadURI, Objects.requireNonNull(pf.index)!!.file)?.let {
|
index.hashFormat?.let { hashFormat ->
|
||||||
pf.index!!.hashFormat?.let { it1 ->
|
processIndex(
|
||||||
processIndex(it,
|
newLoc,
|
||||||
getHash(Objects.requireNonNull(pf.index!!.hashFormat)!!, Objects.requireNonNull(pf.index!!.hash)!!), it1, manifest, invalidatedUris)
|
getHash(index.hashFormat!!, index.hash!!),
|
||||||
|
hashFormat,
|
||||||
|
manifest,
|
||||||
|
invalidatedUris
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e1: Exception) {
|
} catch (e1: Exception) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user