×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    28

    Series 60 null pointer exception

    I have a 'private static final in array' - *sometimes* I get a null pointer exception when getting the length of this array (length = myArray.length) in my drawing routine.

    Whilst this exception is generated (which I Catch), my logic which also gets this array length is fine :?

    Any ideas?
    It only happens *sometimes* but occurs frame after frame after frame! and only ever happens on Series 60 handsets - not the emulator!!!

    Thanks in advance,
    confused :?

  2. #2
    Registered User
    Join Date
    Aug 2004
    Posts
    33
    just try this:

    use a
    if(array != null) do whatever

    then this error won't occur.
    If it does, it it a bug!!

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    28
    Cheers, but I'm puzzled as it's a static final array - it should never *sometimes* fail to get it's length.

  4. #4
    Registered User
    Join Date
    Aug 2004
    Posts
    33
    A final variable can be initialized once. But before it is, it will still be null

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    28
    My array is initialised only once, and well before any code begins to read from it

  6. #6
    Registered User
    Join Date
    Aug 2004
    Posts
    33
    Mhh.
    Then it's fo sure a bug.

    I got sooo many unexplainable bugs on Nokia 6600 Cellphones. It's cruel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •