1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

as_range: Catch TypeErrors

This commit is contained in:
Jeremy Stretch
2020-12-21 11:54:35 -05:00
parent b09112941a
commit 278c881059

View File

@@ -213,6 +213,10 @@ def as_range(n):
"""
Return a range of n items.
"""
try:
int(n)
except TypeError:
return list()
return range(n)