Typescript Get First Element Of Nullable Object