From c34ec5b50c6bff695c6ffdbdaaa02853b3e4149b Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Mon, 17 Nov 2014 13:52:52 +0100 Subject: [PATCH] Fix limit case for non existant neighbors --- taiga/base/neighbors.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/taiga/base/neighbors.py b/taiga/base/neighbors.py index 7b4adbfb..d803b4ae 100644 --- a/taiga/base/neighbors.py +++ b/taiga/base/neighbors.py @@ -53,6 +53,9 @@ def get_neighbors(obj, results_set=None): cursor = connection.cursor() cursor.execute(query, params) row = cursor.fetchone() + if row is None: + return Neighbor(None, None) + obj_position = row[1] - 1 try: