message: Fix comparing statless items
  Fixes
diff: @@ -17,6 +17,7 @@ import Sheet from '../dim-ui/Sheet';
  import { showNotification } from '../notifications/notifications';
  import { scrollToPosition } from 'app/dim-ui/scroll';
  import { DestinyDisplayPropertiesDefinition } from 'bungie-api-ts/destiny2';
  +import idx from 'idx';
  interface StoreProps {
  ratings: ReviewsState['ratings'];
  @@ -276,11 +277,13 @@ class Compare extends React.Component<Props, State> {
  private itemClick = (item: DimItem) => {
  // TODO: this is tough to do with an ID since we'll have multiple
  - let element = document.getElementById(item.index)!;
  + const element = idx(
  + document.getElementById(item.index),
  + (e) => e.parentNode.parentNode
  + ) as HTMLElement;
  if (!element) {
  throw new Error(`No element with id ${item.index}`);
  }
  - element = element.parentNode!.parentNode! as HTMLElement;
  const elementRect = element.getBoundingClientRect();
  const absoluteElementTop = elementRect.top + window.pageYOffset;
  scrollToPosition({ left: 0, top: absoluteElementTop - 150 });
  @@ -315,7 +318,7 @@ class Compare extends React.Component<Props, State> {
  };
  private findArchetypes = (similarTypes: DimItem[], compare = this.state.comparisons[0]) => {
  - if (!compare) {
  + if (!compare || !compare.stats) {
  return [];
  }
  @@ -328,11 +331,11 @@ class Compare extends React.Component<Props, State> {
  // 4284893193 is RPM in D2
  s.statHash === (compare.isDestiny1() ? compare.stats![0].statHash : 4284893193);
  - const archetypeStat = compare.stats!.find(isArchetypeStat);
  + const archetypeStat = compare.stats.find(isArchetypeStat);
  const byStat = (item: DimItem) => {
  if (item.bucket.inWeapons) {
  - const archetypeMatch = item.stats!.find(isArchetypeStat);
  + const archetypeMatch = item.stats && item.stats.find(isArchetypeStat);
  if (!archetypeMatch) {
  return false;
  }
  @@ -397,7 +400,7 @@ function getAllStats(comparisons: DimItem[], ratings: ReviewsState['ratings']) {
  enabled: false,
  lowerBetter: false,
  getStat(item: DimItem) {
  - return item.primStat!;
  + return item.primStat || undefined;
  }
  });
  }
  @@ -418,7 +421,7 @@ function getAllStats(comparisons: DimItem[], ratings: ReviewsState['ratings']) {
  enabled: false,
  lowerBetter: false,
  getStat(item: DimItem) {
  - return item.stats!.find((s) => s.statHash === stat.statHash)!;
  + return item.stats ? item.stats.find((s) => s.statHash === stat.statHash) : undefined;
  }
  };
  statsByHash[stat.statHash] = statInfo;
  