stencila/hub

TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'

sentry-io opened this issue · 0 comments

This exception happened due to a "manual" entry for a file in a snapshot (required because of a missing entry due to another issue). In any case, we should be defensive here (oh wouldn't typing be nice:)

Sentry Issue: HUB-15X

TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'
  File "django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "projects/ui/views/snapshots.py", line 35, in retrieve
    files = files_viewset.get_queryset(project=project, snapshot=snapshot)
  File "projects/api/views/files.py", line 146, in get_queryset
    info["size"] += file.size