I'd move this null-check to the parameters class, code gets much cleaner.