diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c
index 812a03f..1f063f0 100644
--- a/contrib/pageinspect/hashfuncs.c
+++ b/contrib/pageinspect/hashfuncs.c
@@ -70,6 +70,17 @@ verify_hash_page(bytea *raw_page, int flags)
 				 errmsg("index table contains corrupted page")));
 
 	pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
+
+	/* Check if it is an unused hash page. */
+	if (pageopaque->hasho_flag == LH_UNUSED_PAGE)
+		return page;
+
+	/* Check if it is an empty hash page. */
+	if (PageIsEmpty(page))
+		ereport(ERROR,
+				(errcode(ERRCODE_INDEX_CORRUPTED),
+				 errmsg("index table contains empty page")));
+
 	if (pageopaque->hasho_page_id != HASHO_PAGE_ID)
 		ereport(ERROR,
 				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
