Issue #16856: Fix a segmentation fault from calling repr() on a dict with
a key whose repr raise an exception.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 3b307ed..1522a16 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -10672,7 +10672,7 @@
         return;
     }
     left = *p_left;
-    if (right == NULL || !PyUnicode_Check(left)) {
+    if (right == NULL || left == NULL || !PyUnicode_Check(left)) {
         if (!PyErr_Occurred())
             PyErr_BadInternalCall();
         goto error;