QNdefRecord: fix construction from an empty record


A default-constructed QNdefRecord has its d_ptr == nullptr.
However, all classes derived from QNdefRecord implemented their copy
constructors with the assumption that d_ptr is non-null.
This caused a crash when copy-constructing from a default-constructed
QNdefRecord.

Fix by adding proper checks.

Amends 29ba8297443cf76d4f647bde329d62c2a567c709 (beginning of the
public history for the module)
and db2fc63155e8c821f5c6c751a33974cab9cb4ed3 (5.2)

Fixes: QTBUG-151318
Pick-to: 6.12 6.8 6.5 5.15
Change-Id: I385d89dcd8742bb96203c19e45ff26c407c00519
Reviewed-by: Mate Barany <mate.barany@qt.io>
commit05a16fe103624202d2b0ed37fe1a894f672c5afb
parent70e0c5d16a07c96ff9402d9595066e5918bc489f
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeTue, 13 Oct 2026 06:19:49 +0000