Merge pull request #3517 from Juude/bugfix/input_press
wiki / sync_wiki (push) Has been cancelled Details

fix crash when the model of the  history item is deleted
This commit is contained in:
jxt1234 2025-05-12 11:46:22 +08:00 committed by GitHub
commit f7ec9237e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View File

@ -104,7 +104,16 @@ class MainActivity : AppCompatActivity() {
progressDialog!!.show() progressDialog!!.show()
if (destPath == null) { if (destPath == null) {
destPath = destPath =
ModelDownloadManager.getInstance(this).getDownloadedFile(modelId!!)!!.absolutePath ModelDownloadManager.getInstance(this).getDownloadedFile(modelId!!)?.absolutePath
if (destPath == null) {
Toast.makeText(
this,
getString(R.string.model_not_found, modelId),
Toast.LENGTH_LONG
).show()
progressDialog?.dismiss()
return
}
} }
val isDiffusion = ModelUtils.isDiffusionModel(modelId!!) val isDiffusion = ModelUtils.isDiffusionModel(modelId!!)
var configFilePath: String? = null var configFilePath: String? = null

View File

@ -97,4 +97,5 @@
<string name="regenerate">重新生成</string> <string name="regenerate">重新生成</string>
<string name="copy_audio_info">Copy Audio Info</string> <string name="copy_audio_info">Copy Audio Info</string>
<string name="report_crash">Report Crash</string> <string name="report_crash">Report Crash</string>
<string name="model_not_found">Model not foud %1$s</string>
</resources> </resources>

View File

@ -97,4 +97,5 @@
<string name="regenerate">Regenerate</string> <string name="regenerate">Regenerate</string>
<string name="copy_audio_info">Copy Audio Info</string> <string name="copy_audio_info">Copy Audio Info</string>
<string name="report_crash">Report Crash</string> <string name="report_crash">Report Crash</string>
<string name="model_not_found">Model not foud %1$s</string>
</resources> </resources>