Check pointer for NULL before dereferencing it, not after.
Check pointer for NULL before dereferencing it, not after.

PR:		138390
Submitted by:	Patroklos Argyroudis <argp@census-labs.com>
MFC after:	1 week

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase