Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9108289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:46:27+00:00 2026-06-17T02:46:27+00:00

I apologize if this might be similar to my previous question. Why does searching

  • 0

I apologize if this might be similar to my previous question. Why does searching for a node which doesn’t exist in JSON parse cause every other valid node to fail?

 json.track.wiki.summary causes all to error
 json.track.name  is fine if used without the previous

//JSON data
{
    "track": {
        "id": "434483410",
        "name": "Written in the Stars",
        "mbid": "",
        "url": "http://www.last.fm/music/Tinie+Tempah+(Feat.+Eric+Turner)/_/Written+in+the+Stars",
        "duration": "208000",
        "streamable": {
            "#text": "0",
            "fulltrack": "0"
        },
        "listeners": "108",
        "playcount": "1523",
        "artist": {
            "name": "Tinie Tempah (Feat. Eric Turner)",
            "mbid": "",
            "url": "http://www.last.fm/music/Tinie+Tempah+(Feat.+Eric+Turner)"
        },
        "toptags": "\n "
    }
}

Subsequent access will error for valid nodes. Eliminate the request for missing data and subsequent request will work. there must be a way to test an object before you use it so it won’t FUBAR the data.

This data would be OK

//JSON Data
{
"track": {
    "id": "517047006",
    "name": "Skyscraper",
    "mbid": "a92f853d-ad6d-490e-a820-4cff9cc1f224",
    "url": "http://www.last.fm/music/Demi+Lovato/_/Skyscraper",
    "duration": "222000",
    "streamable": {
        "#text": "1",
        "fulltrack": "0"
    },
    "listeners": "114757",
    "playcount": "1424456",
    "artist": {
        "name": "Demi Lovato",
        "mbid": "faf4cefb-036c-4c88-b93a-5b03dd0a0e6b",
        "url": "http://www.last.fm/music/Demi+Lovato"
    },
    "album": {
        "artist": "Demi Lovato",
        "title": "Unbroken",
        "mbid": "9c195a9b-2db4-4b63-9337-6d8152244742",
        "url": "http://www.last.fm/music/Demi+Lovato/Unbroken",
        "image": [{
            "#text": "http://userserve-ak.last.fm/serve/64s/69672054.png",
            "size": "small"
        }, {
            "#text": "http://userserve-ak.last.fm/serve/126/69672054.png",
            "size": "medium"
        }, {
            "#text": "http://userserve-ak.last.fm/serve/174s/69672054.png",
            "size": "large"
        }, {
            "#text": "http://userserve-ak.last.fm/serve/300x300/69672054.png",
            "size": "extralarge"
        }],
        "@attr": {
            "position": "11"
        }
    },
    "toptags": {
        "tag": [{
            "name": "pop",
            "url": "http://www.last.fm/tag/pop"
        }, {
            "name": "ballad",
            "url": "http://www.last.fm/tag/ballad"
        }, {
            "name": "female vocalists",
            "url": "http://www.last.fm/tag/female%20vocalists"
        }, {
            "name": "inspirational",
            "url": "http://www.last.fm/tag/inspirational"
        }, {
            "name": "demi lovato",
            "url": "http://www.last.fm/tag/demi%20lovato"
        }]
    },
    "wiki": {
        "published": "Sat, 20 Aug 2011 18:25:23 +0000",
        "summary": "The Skyscraper Songfacts says: On November 1, 2010, Demi's publicist announced the Disney star had entered a treatment facility for "
        physical and emotional issues,
        " which was subsequently reported to include an eating disorder and self-cutting. Her first single since her stint in treatment finds the singer/actress finding strength in the wake of a fading relationship and it symbolizes her resilience in the face of her personal issues.",
        "content": "The Skyscraper Songfacts says: On November 1, 2010, Demi's publicist announced the Disney star had entered a treatment facility for "
        physical and emotional issues,
        " which was subsequently reported to include an eating disorder and self-cutting. Her first single since her stint in treatment finds the singer/actress finding strength in the wake of a fading relationship and it symbolizes her resilience in the face of her personal issues.\n \nUser-contributed text is available under the Creative Commons By-SA License and may also be available under the GNU FDL."
    }
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:46:28+00:00Added an answer on June 17, 2026 at 2:46 am

    The error is not causing the other code to fail. When the first line errors it stops execution so that the other code is never reached.

    You can add something like this:

    if(json && json.track && json.track.wiki){
        // do something with json.track.wiki.summary
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apologize if this might be a somewhat similar question to others out there,
This is a homework question, which is why it might be somewhat odd(also apologize
I apologize since this might be a common question, but I think I am
This question might be very easy to answer so I apologize if I missed
This question might be very abstract, so apologize in advance. I have a log
I apologize in advance for asking this question, I know similar questions have already
This might be a bit of a noob question, so I apologize in advance.
All, Apologies in advance - this question might be too open-ended for SO. Anyway...
I apologize if this is a duplicate question, I searched a bit and couldn't
I apologize if this is a duh question. It seems like the answer should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.