As the concept of a public channel has been removed from discord this method may return null for newer guild.
The default channel is now different for each user and depends on their permissions, see
Member#getDefaultChannel() for more details.
If you want to get the default channel of old guilds you can use guild.getTextChannelById(guild.getIdLong()).
This will be removed in a future version!