Discussion posts and replies are publicly visible
As the error states. you feed a NULL value into the text() function. You will need to add a null check or use the a!defaultValue() function.