Fixing a bug where the absence of the layout params would result in a null pointer