Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CF Error: Invalid list index 1

Status
Not open for further replies.

3dColor

Programmer
Jan 10, 2006
240
US
I get a Coldfusion error each time someone (or something) comes to my site with no agent user declared.

Code:
CF Error: Invalid list index 1. In function ListGetAt(list, index [, delimiters]), the value of index, 1, is not a valid as the first argument (this list has 0 elements).&nbsp;Valid indexes are in the range 1 through the number of elements in the list. <br>The error occurred on line 17.

This is my code around line 17:
Code:
<!--- 301 redirect to [URL unfurl="true"]www version[/URL] of site, cgi.http_host gives you [URL unfurl="true"]www.mydomain.com[/URL] --->
<cfif domain NEQ "[URL unfurl="true"]www.mydomain.com"[/URL] AND NOT ISDEFINED("URL.cs")>
	<!--- set nonwwws to what is possibly a subdomain or ad id --->
    <cfset nonwwws = listGetAt(domain, 1, ".")>
	<cfif nonwwws EQ "rentvine">
		<cfheader statuscode="301" statustext="Moved permanently">
		<cfheader name="Location" value="[URL unfurl="true"]http://www.#widgetURL#/">[/URL]
	</cfif>
</cfif>

Any ideas how to prevent this error?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top