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 7977877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:20:09+00:00 2026-06-04T09:20:09+00:00

i have a situation where i may encounter a possible null, and i don’t

  • 0

i have a situation where i may encounter a possible null, and i don’t want my program to crash. it is only happening for a small % of users and i’m not entirely sure why, but i know the section of code that is doing it. basically the isAchieved() is a check that should return a boolean value, but in a few cases it is returning a null. this is part of a scoreloop library and i have a suspicion the bug might be with their code.

rather than getting a force close and exiting the program is there a way to check if this value is going to return a null and simply skip over this section of code if that is the case?

if (_achievements[ltc].isAchieved()) {
   // Do stuff for 99.9% of users here, but skip if .isAchieved() would force close
}
  • 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-04T09:20:11+00:00Added an answer on June 4, 2026 at 9:20 am
            boolean checker=false;
            try{
                checker=_achievements[ltc].isAchieved();
            }
            catch(NullPointerException e){
            }
            if (checker) {
               //content
            }
    

    Did you think about doing that?.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where some users may come to mistyped pages, from links,
My situation: ClassA may or may not have a parent of type ClassB .
Common situation: I have a client on my server who may update some of
I have the following situation in code, which I suspect may be a bit
Hi this may seem like a weird question, but here's my situation: I have
My situation may be a bit abnormal, but I have foreign keys defined in
i have a strange situation may its a easy fix or something i may
I have a situation where the only way to generate a certain datafile is
I have a situation where I want to run multiple EventMachines in Ruby -
I have a situation where I want to order a column from the highest

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.