[flutter_tools] handle FileSystemException trying to delete temp directory from core_devices.dart (#140415)

Fixes https://github.com/flutter/flutter/issues/140416, the top crasher on stable/3.16.4
This commit is contained in:
Christopher Fujino
2023-12-19 16:08:54 -08:00
committed by GitHub
parent ea6017ded8
commit ef1227f05d
3 changed files with 40 additions and 6 deletions

View File

@@ -5,6 +5,7 @@
import 'package:meta/meta.dart';
import 'package:process/process.dart';
import '../base/error_handling_io.dart';
import '../base/file_system.dart';
import '../base/io.dart';
import '../base/logger.dart';
@@ -101,7 +102,7 @@ class IOSCoreDeviceControl {
_logger.printError('Error executing devicectl: $err');
return <Object?>[];
} finally {
tempDirectory.deleteSync(recursive: true);
ErrorHandlingFileSystem.deleteIfExists(tempDirectory, recursive: true);
}
}