Error: Select list item:List index too large

My app is receiving 11 bytes of data from control system, sometimes the 11th byte is missing and app gives immerdiately the error message "Select list item:List index too large-Attempt to get item number 11 of a list of length 10"
How could i turn off the error display or is it possible to set some fixed value for 11th byte in case of app receive only 10 bytes?

check the length of the list...
http://ai2.appinventor.mit.edu/reference/blocks/lists.html#lengthoflist

if length of list < 11
then set value 11 to default value
else select the 11th item from the list

Taifun


Thanks!

Would it work like this?
If there is not coming 11 bytes, does the "global list" keeps the old values, which has been saved at last time when all 11 bytes were received?

no, you could do it like this

if length of list = 10
then add items to list "your default value for item 11"

http://ai2.appinventor.mit.edu/reference/blocks/lists.html#additems

Taifun