Fixed JavaScript error when opening a ticket that is not closed.