mobile: fix app crash when trying to restore an invalid file

This commit is contained in:
Ammar Ahmed
2026-01-01 10:15:54 +05:00
parent 64074030dd
commit f041b92360

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({