Protect nullptr dereference and fix counters (v35r3-patches)
Protect nullptr dereference and fix counters (follow !3188 (merged))
See merge request !3256 (merged)
(cherry picked from commit ffc71be3)
7d4beb52 Protect nullptr dereference and fix counters (follow !3188 (merged))