diff --git a/features/nfc/source/nfc/ndef/common/Text.cpp b/features/nfc/source/nfc/ndef/common/Text.cpp index 8814c753f9..d66e48f9a6 100644 --- a/features/nfc/source/nfc/ndef/common/Text.cpp +++ b/features/nfc/source/nfc/ndef/common/Text.cpp @@ -118,6 +118,10 @@ Span Text::get_language_code() const Span Text::get_text() const { + if (!_text_record) { + return Span(); + } + size_t language_code_size = get_language_code().size(); return make_const_Span( @@ -138,6 +142,10 @@ bool Text::append_as_record( bool is_last_record ) const { + if (!_text_record) { + return false; + } + // Build the record type RecordType type( RecordType::well_known_type,