"Error #1009" Means you're trying to dereference something that is null.
If you get that error on a line like this:
foo.bar
or
foo['bar']
It means that foo itself is null, not that foo exists and doesn't contain a
"bar" field.
A tip: When you get this exception, try using the "Variables" window in the
debugger to help track down what it is that's giving you curry!
-Josh
On Wed, Jul 30, 2008 at 4:43 PM, Rafael Faria
<[EMAIL PROTECTED]>wrote:
> For instance
>
> parentApplication.appData['moduleParams'].table_name
>
>
> 'moduleParams' is an object as well. it might not exist, and
> table_name might not exist... i need to test if table_name exists...
>
> anything i put it returns
>
> Error: Error #1009: Cannot access a property or method of a null
> object reference.
> at...
>
>
> i tried
> if ((parentApplication.appData['moduleParams'] == null) ||
> (!parentApplication.appData['moduleParams'].moduleFrom)) {
> }
>
> i tried
>
> if ((!parentApplication.appData.hasOwnProperty('moduleParams')) ||
> (!parentApplication.appData.hasOwnProperty('moduleParams').moduleFrom)) {
> }
>
> or
>
> if ((!('moduleParams' in parentApplication.appData)) ||
> (!('moduleFrom' in parentApplication.appData['moduleParams']))) {
> }
>
> same error...
>
> anyone can help me how i would test if
>
> parentApplication.appData['moduleParams'].table_name
> exists?
>
>
> rafael
>
>
>
>
> --- In [email protected], "Josh McDonald" <[EMAIL PROTECTED]> wrote:
> >
> > If it's an array, then you want:
> >
> > if(archive[record_id].length > 1)
> > {
> > //do stuff
> > }
> >
> > -Josh
> >
> > On Tue, Jul 29, 2008 at 2:05 PM, Rafael Faria
> > <[EMAIL PROTECTED]>wrote:
> >
> > > Hello all,
> > >
> > > I'm here for one of my questions again :P
> > >
> > > I need to make a comparison like this
> > >
> > > if (archive[record_id][1].deleted_id == deleted_id) {
> > >
> > > }
> > > My problem is that [1].deleted_id might not exist at this point.
> > >
> > > I know that archive[record_id] exists so how can i make this
> > > comparison above?
> > >
> > > [1] might not exists and i can't use hasOwnProperty("1") because it
> > > throws an error as well.
> > >
> > > can someone help me?! :P
> > >
> > > raf
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > --
> > > 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."
> >
> > :: Josh 'G-Funk' McDonald
> > :: 0437 221 380 :: [EMAIL PROTECTED]
> >
>
>
>
> ------------------------------------
>
> --
> 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."
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]