import struct


def read_body_array(packet_body):
    """
    Reads array formatted struct packet body. On error returns None.

    :param packet_body: Body of packet
    :return: Array of items
    """
    size_fmt = '!i'
    string_fmt = '!%ds'

    body_array = []
    body_len = len(packet_body)
    offset = 0
    if body_len <= 0:
        return None

    try:
        while offset < body_len:
            # Read size of item
            item_size = struct.unpack_from(size_fmt, packet_body, offset)[0]
            offset += 4
            # Read string
            item_string = struct.unpack_from(string_fmt % item_size, packet_body, offset)[0]
            body_array.append(item_string)
            offset += item_size

        return body_array
    except (struct.error, TypeError):
        return None