Skip to content

Commit 1615831

Browse files
committed
Fix formatting nullptr
1 parent 9773903 commit 1615831

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

binaryninjaapi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20976,6 +20976,8 @@ template<typename T> struct fmt::formatter<BinaryNinja::Ref<T>>
2097620976
fmt::formatter<T> inner;
2097720977
format_context::iterator format(const BinaryNinja::Ref<T>& obj, format_context& ctx) const
2097820978
{
20979+
if (obj.GetPtr() == nullptr)
20980+
return fmt::format_to(ctx.out(), "{}", "<null>");
2097920981
return inner.format(*obj.GetPtr(), ctx);
2098020982
}
2098120983
constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return inner.parse(ctx); }

0 commit comments

Comments
 (0)