If the data_loader is empty, i will be undefined:
def fun():
    for i in range(0):
        print('inside loop')
    return 1 / i

fun()
> UnboundLocalError: local variable 'i' referenced before assignment

PS: I would still recommend to post code snippets directly instead of screenshots.