Select to view content in your preferred language

Problems encountered using query and queryTask

539
1
04-06-2010 11:12 AM
RichardKrell
Emerging Contributor
I have been working on a simple query for a map service I have running.  The problem is on the first query of every seesion I get the following error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at testQuery2/private:doQuery/onResult()
at mx.rpc::AsyncResponder/result()
at com.esri.ags.tasks::QueryTask/handleDecodedObject()
at Function/http://adobe.com/AS3/2006/builtin::call()
at com.esri.ags.tasks::BaseTask/handleResult()
at <anonymous>()
at mx.rpc::Responder/result()
at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()
at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
at mx.rpc.http.mxml::HTTPService/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

But when I tell it to "Dismiss All" it returns what I am looking for and from then on all queries seem to be working fine.  I have attached the code to this post.  the one thing I have noticed when I debug it is that the "where" value is null even though there is a value there.

Thanks
Any Help would be greatly appriciated
Tags (2)
0 Kudos
1 Reply
MehulChoksey
Esri Contributor
Error is on line 32
var mp:Multipoint = new Multipoint([],myGraphic.geometry.spatialReference);
the variable mp is not being used in rest of the code. Runtime error will not be thrown if this line is commented out.

Mehul Choksey
ArcGIS API for Flex
0 Kudos