Fix logic bug that triggered assert.
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index 389b103..50568e7 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -379,8 +379,9 @@
     CLEAR_DBT(*dbt);
     if (obj == Py_None) {
         /* no need to do anything, the structure has already been zeroed */
+        return 1;
     }
-    else if (!PyBytes_Check(obj)) {
+    if (!PyBytes_Check(obj)) {
         PyErr_SetString(PyExc_TypeError,
                         "Data values must be of type bytes or None.");
         return 0;