W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

Re: nullpointer

From: Americo Albuquerque <chainsword@altavista.com>
Date: 1 Jun 2001 03:51:55 -0700
Message-ID: <20010601105155.1604.cpmta@c012.sfo.cp.net>
To: keshlam@us.ibm.com
Cc: www-dom@w3.org
On Thu, 31 May 2001, "Joseph Kesselman" wrote:

> 
> 
> >x.setStart(document.getElementsByTagName("p")[0],0);
You have to check if element document.getElementsByTagName("p") exists or it will crash when you try to get document.getElementsByTagName("p")[0] since you can not get an array value from a null pointer.

> >x.insertNode(document.getElementsByTagName("div")[0]);
the same applies to document.getElementsByTagName("div")


Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com
Received on Friday, 1 June 2001 06:52:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT