title: Need solution for if statement logic
body: <p>I need help on a condition logic using if statement as following:</p>
  
  <ul>
  <li>Variables A and B contain 3 properties which is level1, level2 and level3.</li>
  <li>level1 and level2 can be 0 or more and level3 is null or numeric.</li>
  <li>Variables A and B can be null.</li>
  </ul>
  
  <p>Currently I have this condition:</p>
  
  <pre><code>if (A.level1 == 0 and B.level1 == 0) {
    code here
  } else if (A.level2 == 0 and B.level2 == 0) {
    code here
  } else if (A.level3 != null and B.level3 != null) {
    code here
  }
  </code></pre>
  
  <p>The problem is that this code doesn't handle the <code>Variables A and B can be null</code> part. The code should handle that part like this: </p>
  
  <ul>
  <li>When A is null, B will still go through the same condition but without A and vice versa.</li>
  <li>However, if A and B is null then the condition will be false at once.</li>
  </ul>
  
  <p>I have problem in how to implement the <code>Variables A and B can be null</code> part in my condition, any advice?</p>