Handle errors when there's no active window