def protected(func):
    'Prevent fatal crashes from illegal access to deleted nodes'
    if ROGUE_MODE:
        return func

    @wraps(func)
    def func_wrapper(*args, **kwargs):
        if args[0]._destroyed:
            raise ExistError('Cannot perform operation on deleted node')
        return func(*args, **kwargs)
    return func_wrapper
Prevent fatal crashes from illegal access to deleted nodes
def protected(func):
    
    if ROGUE_MODE:
        return func

    @wraps(func)
    def func_wrapper(*args, **kwargs):
        if args[0]._destroyed:
            raise ExistError('Cannot perform operation on deleted node')
        return func(*args, **kwargs)
    return func_wrapper