diff --git a/datasette/facets.py b/datasette/facets.py
index 76d73e5..07a4034 100644
--- a/datasette/facets.py
+++ b/datasette/facets.py
@@ -499,11 +499,14 @@ class ManyToManyFacet(Facet):
"outgoing"
]
if len(other_table_outgoing_foreign_keys) == 2:
- destination_table = [
- t
- for t in other_table_outgoing_foreign_keys
- if t["other_table"] != self.table
- ][0]["other_table"]
+ try:
+ destination_table = [
+ t
+ for t in other_table_outgoing_foreign_keys
+ if t["other_table"] != self.table
+ ][0]["other_table"]
+ except IndexError:
+ import pdb; pdb.pm()
# Only suggest if it's not selected already
if ("_facet_m2m", destination_table) in args:
continue
This may help debug: