This issue is caused by the fact that servers below 1.19.1 send the ClientboundStatusResponsePacket without the enforcesSecureChat boolean field (previously also known as the previewsChat boolean field). Since this field is non-existent in lower versions, trying to do a STATUS connection to a server from these versions will fail, and throw a NullPointerException.
The fix
Check if the field is null, and if it is, then default to false.
The cause
This issue is caused by the fact that servers below 1.19.1 send the ClientboundStatusResponsePacket without the enforcesSecureChat boolean field (previously also known as the previewsChat boolean field). Since this field is non-existent in lower versions, trying to do a STATUS connection to a server from these versions will fail, and throw a NullPointerException.
The fix
Check if the field is null, and if it is, then default to false.