Index: runtime/bin/gen_snapshot.cc |
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc |
index cf1ba385e2362470dfa58e6859159d3b17b22836..05452ae26dffa59dbc800927030c40596ac31866 100644 |
--- a/runtime/bin/gen_snapshot.cc |
+++ b/runtime/bin/gen_snapshot.cc |
@@ -382,7 +382,12 @@ static void WriteSnapshotFile(const char* filename, |
const uint8_t* buffer, |
const intptr_t size) { |
File* file = File::Open(filename, File::kWriteTruncate); |
- ASSERT(file != NULL); |
+ if (file == NULL) { |
+ Log::PrintErr("Error: Unable to write snapshot file: %s\n\n", filename); |
+ Dart_ExitScope(); |
+ Dart_ShutdownIsolate(); |
+ exit(kErrorExitCode); |
+ } |
if (!file->WriteFully(buffer, size)) { |
Log::PrintErr("Error: Failed to write snapshot file.\n\n"); |
} |