Fixed null reference exception for null parameters

Fixed null reference exception in the debug logging that occurs when parameters are null.