Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: proxyNameCache is null inside FabricationProxy  (Read 4834 times)
gregbown
Jr. Member
**
Posts: 16


View Profile Email
« on: September 12, 2009, 02:40:11 »

Error #1009: Cannot access a property or method of a null object reference. thrown on sendNotification inside a proxy

I have two proxies instantiated in my application startup command however one is coming up null unless I use a setTimeout inside the proxy to send notifications.  I tried changing the order of instantiation and even tried an addProxyCommand.

The debugger points to a null value inside FabricationProxy and sure enough proxyNameCache is null inside FabricationProxy line 212 unless I add some kind of delay in witch case it is fine.  The weird thing is both proxies send notifications so why does one throw the error and the other not.  They both have static public const NAME:String="Name of Proxy" and call super(NAME); in their constructor.  Both extend FabricationProxy

The only thing that prevents the error is using a setTimeout to send the notification
Logged
gregbown
Jr. Member
**
Posts: 16


View Profile Email
« Reply #1 on: September 13, 2009, 10:22:51 »

Ok I think I found the answer but any of you more seasoned Fabrication guys can correct me if I'm wrong.
After some searching around I found this post http://lowpitch.com/blog/puremvc-multicore-vs-standard-singlecore/
So I thought I would check to see if that method was in FabricationProxy and it was. After adding the method to my proxy all is fine.

   override public function initializeNotifier(key:String):void {
         super.initializeNotifier(key);
         
         initializeProxyNameCache();
         // initialize methods in proxy after this
      }
Logged
Pages: [1]
Print