Raise better error in NeighborList.curitem if no index is set
This commit is contained in:
parent
b59f0e9a34
commit
7da05b3fb9
@ -104,7 +104,10 @@ class NeighborList:
|
||||
|
||||
def curitem(self):
|
||||
"""Get the current item in the list."""
|
||||
if self.idx is not None:
|
||||
return self._items[self.idx]
|
||||
else:
|
||||
raise IndexError("No current item!")
|
||||
|
||||
def nextitem(self):
|
||||
"""Get the next item in the list."""
|
||||
|
Loading…
Reference in New Issue
Block a user