Merge "Asserting flashing plan is used in do_flash" into main
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index eee0e93..79c7169 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1489,10 +1489,13 @@
void do_flash(const char* pname, const char* fname, const bool apply_vbmeta,
const FlashingPlan* fp) {
+ if (!fp) {
+ die("do flash was called without a valid flashing plan");
+ }
verbose("Do flash %s %s", pname, fname);
struct fastboot_buffer buf;
- if (fp && fp->source) {
+ if (fp->source) {
unique_fd fd = fp->source->OpenFile(fname);
if (fd < 0 || !load_buf_fd(std::move(fd), &buf, fp)) {
die("could not load '%s': %s", fname, strerror(errno));