diff --git a/django/contrib/contenttypes/generic.py b/django/contrib/contenttypes/generic.py
index 5564548..4df48ff 100644
a
|
b
|
class BaseGenericInlineFormSet(BaseModelFormSet):
|
317 | 317 | def get_queryset(self): |
318 | 318 | # Avoid a circular import. |
319 | 319 | from django.contrib.contenttypes.models import ContentType |
320 | | if self.instance is None: |
| 320 | if self.instance is None or self.instance.pk is None: |
321 | 321 | return self.model._default_manager.none() |
322 | 322 | return self.model._default_manager.filter(**{ |
323 | 323 | self.ct_field.name: ContentType.objects.get_for_model(self.instance), |