[#2212] CID25696:

Added null check to avoid null dereference
[#2212] CID25687:

Re-ordered assignment inside if statement to avoid unintentional
short-circuit
[#2212] CID25669:

Moved function call inside conditional to avoid null dereference