Skip to content

Commit

Permalink
Fix null pointer when backing up and no backup directory is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
nonproto committed Mar 14, 2024
1 parent e3c136c commit 4f26a47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ class SettingsDataController : SettingsController() {

fun createBackup(flags: Int) {
backupFlags = flags
if (storageManager.getBackupDirectory() == null) {
activity?.toast(R.string.no_backup_directory_selected)
return
}
try {
// Use Android's built-in file creator
val intent =
Expand Down
1 change: 1 addition & 0 deletions constants/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@
<string name="invalid_backup_file">Invalid backup file</string>
<string name="invalid_backup_file_type">Invalid backup file type: %1$s\nIt should end with ".proto.gz" or ".json".</string>
<string name="file_is_missing_data">File is missing data.</string>
<string name="no_backup_directory_selected">No backup directory selected</string>
<string name="backup_has_no_manga">Backup does not contain any manga.</string>
<string name="backup_failed">Backup failed</string>
<string name="empty_backup_error">No library entries to back up</string>
Expand Down

0 comments on commit 4f26a47

Please sign in to comment.