Allow setSelect to accept a null parameter

Currently setSelect throws an exception if the 'rect' parameter passed to it is null. Added a guard clause to return out of the function if the parameter is null.