diff --git a/src/backend/utils/adt/int.c b/src/backend/utils/adt/int.c
index 2add22c04f508d7e2f5b0710c49007ca237f5a61..244bf3aaa4ba4d4a1b1180122bb7da16e881ff19 100644
--- a/src/backend/utils/adt/int.c
+++ b/src/backend/utils/adt/int.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.33 2000/02/21 03:36:48 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.34 2000/03/07 23:58:38 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -288,6 +288,9 @@ text_int2(text *string)
 	int			len;
 	char	   *str;
 
+	if (!string)
+		return 0;
+
 	len = (VARSIZE(string) - VARHDRSZ);
 
 	str = palloc(len + 1);
@@ -329,6 +332,9 @@ text_int4(text *string)
 	int			len;
 	char	   *str;
 
+	if (!string)
+		return 0;
+
 	len = (VARSIZE(string) - VARHDRSZ);
 
 	str = palloc(len + 1);