diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index 4f209eab68896f2006e8a8459ad11ba6cfc7ebf5..b659c320585c9aef6302c0723dc29ff1c16354db 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -193,6 +193,10 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
 	TimestampTz waitStart;
 	char	   *new_status;
 
+	/* Fast exit, to avoid a kernel call if there's no work to be done. */
+	if (!VirtualTransactionIdIsValid(*waitlist))
+		return;
+
 	waitStart = GetCurrentTimestamp();
 	new_status = NULL;		/* we haven't changed the ps display */