diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
new file mode 100644
index 5c11d68..d23f06b
*** a/src/backend/replication/walsender.c
--- b/src/backend/replication/walsender.c
*************** WalSndCheckTimeOut(TimestampTz now)
*** 1738,1744 ****
  	timeout = TimestampTzPlusMilliseconds(last_reply_timestamp,
  										  wal_sender_timeout);
  
! 	if (wal_sender_timeout > 0 && now >= timeout)
  	{
  		/*
  		 * Since typically expiration of replication timeout means
--- 1738,1744 ----
  	timeout = TimestampTzPlusMilliseconds(last_reply_timestamp,
  										  wal_sender_timeout);
  
! 	if (last_reply_timestamp > 0 && wal_sender_timeout > 0 && now >= timeout)
  	{
  		/*
  		 * Since typically expiration of replication timeout means
