Discussion posts and replies are publicly visible
This occurs when the CDT you are trying to persist to the database is null. Why are you trying to save a null value? If your CDT may be null in some cases, I would suggest to put an XOR node in place to check and bypass the Write to DS service in that case.
In addition to Chris suggestion