Line 144 of subproducts.module fails:
unset($subproduct[0]);
This is because $subproduct is an object.