[engine] Fix NPE while collecting variables data containing variable with null
value
#4994
+16
−7
null
value
#4994