diff --git a/lib/cli/troubleshootcollectcommand.cpp b/lib/cli/troubleshootcollectcommand.cpp index f243424f1..6ffc76e38 100644 --- a/lib/cli/troubleshootcollectcommand.cpp +++ b/lib/cli/troubleshootcollectcommand.cpp @@ -357,10 +357,9 @@ void TroubleshootCollectCommand::CheckObjectFile(const String& objectfile, InfoL bool first = true; - if (print) - ObjectListUtility::PrintObject(std::ostream(NULL), first, message, type_count, "", ""); - else - ObjectListUtility::PrintObject(std::ostream(NULL), first, message, type_count, "", ""); + std::ofstream badstream; + + ObjectListUtility::PrintObject(badstream, first, message, type_count, "", ""); Dictionary::Ptr object = JsonDecode(message); Dictionary::Ptr properties = object->Get("properties");