From b6f3075ba4f2d27e8226285b9aa4e969696485bc Mon Sep 17 00:00:00 2001
From: Edward Betts <edward@4angle.com>
Date: Thu, 11 Oct 2018 21:16:28 +0100
Subject: [PATCH] Avoid crash for malformed xanalink text.

---
 sourcing/model.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sourcing/model.py b/sourcing/model.py
index 5e9286d..2c328af 100644
--- a/sourcing/model.py
+++ b/sourcing/model.py
@@ -299,7 +299,11 @@ class XanaLink(Item):
         if link['type'] != 'title':
             return
 
-        facet1, facet2 = link['facets']
+        try:
+            facet1, facet2 = link['facets']
+        except ValueError:
+            return
+
         link_type, _, ident = facet1[0].partition(': ')
         item = Item.from_external(ident, home)