Fix two cases where we were dereferencing a pointer without checking for NULL.
Fix two cases where we were dereferencing a pointer without checking
for NULL.

Problem reported by coverity tool, via Will Cohen

arm-hpc/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,arm-hpc/papi,arm-hpc/papi