Fix limit case for non existant neighbors
parent
c844e59540
commit
c34ec5b50c
|
@ -53,6 +53,9 @@ def get_neighbors(obj, results_set=None):
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
cursor.execute(query, params)
|
cursor.execute(query, params)
|
||||||
row = cursor.fetchone()
|
row = cursor.fetchone()
|
||||||
|
if row is None:
|
||||||
|
return Neighbor(None, None)
|
||||||
|
|
||||||
obj_position = row[1] - 1
|
obj_position = row[1] - 1
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue