Add null checks for both parameters - you rely upon them not being null later in the code