Merge "Fix an error on bootloadermessager test teardown"
diff --git a/tests/component/bootloader_message_test.cpp b/tests/component/bootloader_message_test.cpp
index c32519d..0357acc 100644
--- a/tests/component/bootloader_message_test.cpp
+++ b/tests/component/bootloader_message_test.cpp
@@ -33,8 +33,10 @@
 
   virtual void TearDown() override {
     // Clear the BCB.
-    std::string err;
-    ASSERT_TRUE(clear_bootloader_message(&err)) << "Failed to clear BCB: " << err;
+    if (has_misc) {
+      std::string err;
+      ASSERT_TRUE(clear_bootloader_message(&err)) << "Failed to clear BCB: " << err;
+    }
   }
 
   bool has_misc;