Fix jquery object not being passed for isEmpty check.