Fix IndexError

Running str.split() on a whitespace-only string results in an empty
list. Enclose variable assignment in a try/except block and skip to
parsing next line of output if an IndexError is detected.

This fixes #4315.