Adds a check for a null or empty handle as input