sync this function with 2.2 (single check for NULL parameter)