diff --git a/engine/src/flutter/tools/pub_get_offline.py b/engine/src/flutter/tools/pub_get_offline.py index 154c08e6d5..c56d74f805 100644 --- a/engine/src/flutter/tools/pub_get_offline.py +++ b/engine/src/flutter/tools/pub_get_offline.py @@ -134,8 +134,10 @@ def delete_config_files(): gitcmd, cwd=ENGINE_DIR, stderr=subprocess.STDOUT, text=True ).splitlines() for file in files_to_delete: - print('Deleting %s...' % file) - os.remove(os.path.join(ENGINE_DIR, file)) + file_path = os.path.join(ENGINE_DIR, file) + if os.path.exists(file_path): + print('Deleting %s...' % file) + os.remove(file_path) def main():