Merge pull request #9124 from streetwriters/fix-invalid-file-crash-on-restore

mobile: fix app crash when trying to restore an invalid file
This commit is contained in:
Ammar Ahmed
2026-01-01 10:26:28 +05:00
committed by GitHub

View File

@@ -95,6 +95,15 @@ const restoreBackup = async (options: {
deleteFile?: boolean;
}) => {
try {
if (
!options.uri.endsWith(".nnbackup") &&
!options.uri.endsWith(".nnbackupz")
) {
throw new Error(
`Invalid backup file selected. Only .nnbackup and .nnbackupz files can be restored.`
);
}
const isLegacyBackup = options.uri.endsWith(".nnbackup");
startProgress({