diff --git a/src/utils/utils.php b/src/utils/utils.php
--- a/src/utils/utils.php
+++ b/src/utils/utils.php
@@ -1888,6 +1888,9 @@
  * @return  string  URI encoded string, except for '/'.
  */
 function phutil_escape_uri($string) {
+  if ($string === null) {
+    return '';
+  }
   return str_replace('%2F', '/', rawurlencode($string));
 }