Handle params which may be undefined.

Sometimes params can be undefined. This ensures this event doesn't cause an error.