Make sure there is a cursor before setting position
Merge pull request #17 from dsandstrom/fix-close-when-tab-gone

Make sure there is a cursor before setting position