Add assert to functions that take pointer parameters.

Check pointer arguments for nullptr.