Typescript Check Variable Is Not Undefined In Division