Fix error when there is no active editor