diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index e42670b..34bbb24 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -6853,11 +6853,13 @@ gtk_entry_get_text_area (GtkEntry     *entry,
 /**
  * gtk_entry_set_text:
  * @entry: a #GtkEntry
- * @text: the new text
+ * @text: (allow-none): the new text, or %NULL
  *
  * Sets the text in the widget to the given
  * value, replacing the current contents.
  *
+ * Since 3.4, @text can be a %NULL pointer.
+ *
  * See gtk_entry_buffer_set_text().
  */
 void
@@ -6868,7 +6870,10 @@ gtk_entry_set_text (GtkEntry    *entry,
   GtkEntryCompletion *completion;
 
   g_return_if_fail (GTK_IS_ENTRY (entry));
-  g_return_if_fail (text != NULL);
+
+  /* Treat NULL strings and empty strings identically. */
+  if (text == NULL)
+    text = "";
 
   /* Actually setting the text will affect the cursor and selection;
    * if the contents don't actually change, this will look odd to the user.
