Skip to content

Commit

Permalink
Another stab at resolving weird null error ref #537
Browse files Browse the repository at this point in the history
  • Loading branch information
FreneticScribbler committed Jun 27, 2023
1 parent 1687407 commit 097e7c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions versioning/versioning.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from diff_match_patch import diff_match_patch
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
Expand Down Expand Up @@ -160,10 +161,9 @@ def item_changes(self):
# Build some dicts of what we have
item_dict = {} # build a list of items, key is the item_pk
for version in old_item_versions: # put all the old versions in a list
old = version._object_version.object
if old is None:
pass
compare = ModelComparison(old=old, **comparisonParams)
if version is None or version._object_version is None:
logging.warning(f"Something was null when it really shouldn't be! {old_item_versions}")
compare = ModelComparison(old=version._object_version.object, **comparisonParams)
item_dict[version.object_id] = compare

for version in new_item_versions: # go through the new versions
Expand Down

0 comments on commit 097e7c2

Please sign in to comment.