Example #1
0
        // conditional access as a source of 'Possible NRE'
        public void M(StringBuilder sb, Analyzers a)
        {
            sb?.Append("aaa");
              a.Builder?.Append("bbb");

              sb.Append("ccc");
              a.Builder.Append("ddd"); // +QF
        }
Example #2
0
        // 'a.P' == 'a?.P'
        public void E(Analyzers a)
        {
            if (a?.Value != null) return;

              if (a != null)
              {
            var t = a.Value.Length; // possible NRE
              }
        }
Example #3
0
 // with dependent analysis
 public void P(Analyzers a)
 {
     var sb = a?.Builder;
       if (sb != null)
       {
     //if (a != null) { }
     a?.ToString(); // redundant ?.
       }
 }