One of those problems, Production always seems to have the bad data :)

If there's any doubt (ie, it's optional in your XSD schema or whatever) I
try to use something like this when populating from a result object:

foo = "foo" in result ? result.foo : null;

Still get caught out from time to time though. Although my newer
reflection-based automagic population code doesn't, not every project has
been updated to it :)

-Josh

On Wed, Sep 10, 2008 at 9:11 AM, scowling_beer <[EMAIL PROTECTED]>wrote:

> Thanks, your post got me thinking a little tangentially.
>
> It was blind faith in the line reported in the debugger that led me
> down a dead end.
> It was reporting that the component and/or method in the component
> were null - however it was actually within the method.
>
> I was harvesting values from a form and the States select box hadn't
> populated (they didn't exist in the database in the second
> environment) so the selectedItem was null.
>
> So it turns out it was a "data" problem after all.
>
> Thanks for all your help and suggestions.
>
> Cheers
> Steve
>
> --- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
> >
> > "Works in dev environment but not in production" soooo often is a
> data
> > service security issue.  Any chance that is the case here?
> >
> >
> >
> > If not, consider adding trace statements in your code around the
> > offending area.  Run the debug swf from the production server from
> your
> > dev maching where you have a debug player.  You will be able to see
> the
> > trace statements.  I use lines like this:
> >
> > trace("myObject is null? " + (myObject == null));
> >
> >
> >
> > Tracy
> >
> > ________________________________
> >
> > From: [email protected]
> [mailto:[EMAIL PROTECTED] On
> > Behalf Of scowling_beer
> > Sent: Tuesday, September 09, 2008 2:38 AM
> > To: [email protected]
> > Subject: [flexcoders] Error #1009: Property or Mehtod of a null
> object
> > reference
> >
> >
> >
> > Hello All,
> >
> > Firstly I understand what causes the #1009 error.
> >
> > What I am having trouble with is reproducing it in my flex
> development
> > environment.
> >
> > I have an application that calls custom components into a ViewStack.
> > When the user changes sections within the viewstack it fires an
> event
> > which calls a public method called saveSection within the custom
> > component - the section they just left.
> >
> > When debugged and run within my Flex dev environment it works fine,
> > until I deploy it to another development machine. It's then that I
> get
> > the Error 1009.
> >
> > This is driving me crazy. This code has previously worked fine.
> >
> > I'm happy to post some pseudo code or examples if needed, but
> generally
> > I'm after advice. If I am viewing the component called into the
> > viewstack... how can it be null? Complicating this is that the same
> code
> > called for the other sections works as expected!
> >
> > The creationPolicy on the viewstack is "all"
> >
> > MainApp
> >   {changeSectionHandler -> oldSection.saveSection()}
> >  ViewStack
> >      SectionA
> >        {saveSection()}
> >      SectionB
> >        {saveSection()}
> >      SectionC
> >        {saveSection()}
> >
> > Any help appreciated.
> >
> > Cheers
> > Steve
> >
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>
>
>


-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

http://flex.joshmcdonald.info/

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]

Reply via email to