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.
Merge pull request #4322 from terminalmage/issue4315

Fix IndexError