Commit ade439c5 authored by Laura Schlimmer's avatar Laura Schlimmer
Browse files

fix potential division by zero

parent a83df9ee
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -160,6 +160,9 @@ double domain_translate_categorical(
    const DomainConfig& domain,
    const Value& v) {
  double category_count = domain.categories.size();
  if (category_count == 0) {
    return 0;
  }

  size_t vi = 0;
  if (auto vm = domain.map.find(v); vm != domain.map.end()) {