Avoid crash when cursor isn't currently set (bug #1043116).