Add null protection in discussions table and model