Skip to content

Commit ae3dd32

Browse files
committed
chore: Some more NPE prevention
1 parent ac4a6d5 commit ae3dd32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ class BackupCreatorJob(private val context: Context, workerParams: WorkerParamet
3131
override fun doWork(): Result {
3232
val storageManager: StorageManager by injectLazy()
3333
val notifier = BackupNotifier(context.localeContext)
34-
val uri = inputData.getString(LOCATION_URI_KEY)?.toUri() ?: storageManager.getAutomaticBackupsDirectory()?.uri!!
34+
val uri = inputData.getString(LOCATION_URI_KEY)?.toUri() ?: storageManager.getAutomaticBackupsDirectory()?.uri
3535
val flags = inputData.getInt(BACKUP_FLAGS_KEY, BackupConst.BACKUP_ALL)
3636
val isAutoBackup = inputData.getBoolean(IS_AUTO_BACKUP_KEY, true)
3737

3838
notifier.showBackupProgress()
3939
return try {
40-
val location = BackupCreator(context).createBackup(uri, flags, isAutoBackup)
40+
val location = BackupCreator(context).createBackup(uri!!, flags, isAutoBackup)
4141
if (!isAutoBackup) notifier.showBackupComplete(UniFile.fromUri(context, location.toUri())!!)
4242
Result.success()
4343
} catch (e: Exception) {

0 commit comments

Comments
 (0)