Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » document.location gives nullpointerexception(Syntax wrong?)
document.location gives nullpointerexception [message #895609] Fri, 13 July 2012 19:06 Go to next message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
RichUI in EDT 0.8.0

This is probably trivial but I am just not able to figure it out. This code gives me a nullpointerexcpetion and I cannot figure out the syntax.

Anyone know what I am doing wrong?

	urlString string = document.location;
Re: document.location gives nullpointerexception [message #895613 is a reply to message #895609] Fri, 13 July 2012 19:39 Go to previous messageGo to next message
Dan Darnell is currently offline Dan Darnell
Messages: 145
Registered: November 2011
Location: Arkansas
Senior Member

It works for me in 0.8.1 M3. Preview mode, external browser, and deployed.

Maybe it's something that was fixed at some point between 0.8.0 and now.

--Dan
Re: document.location gives nullpointerexception [message #896030 is a reply to message #895609] Tue, 17 July 2012 02:06 Go to previous messageGo to next message
fahua jin is currently offline fahua jin
Messages: 58
Registered: July 2011
Member
Quote:

urlString string = document.location;


Nathan,

Did you put the sentence to the body of RUIHandler as instance variable? It does have problem in both 0.8 & 0.81 when you doing so, and a bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=385251 was opened for this.

But you could have following 2 work-around to avoid the problem,

1) Add self before document.location as following: urlString string = self.document.location;
2) Move the urlString string = document.location; to the function as local variable of function.

Hope it could help you.

Rocky
Re: document.location gives nullpointerexception [message #896124 is a reply to message #896030] Tue, 17 July 2012 10:54 Go to previous message
Nathan Reed is currently offline Nathan Reed
Messages: 74
Registered: June 2012
Member
Rocky:

I figured that out yesterday and moved it to the function. You are correct. That gets me around the problem.

Thx,

Nathan Reed
Previous Topic:Set compiler options in EGL New Package wizard
Next Topic:Bad install?
Goto Forum:
  


Current Time: Tue Sep 23 00:30:44 GMT 2014

Powered by FUDForum. Page generated in 0.14363 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software