Fixed error when widget has no parts

was creating an array with an undefined element in it instead of an
empty array