Fix null pointer dereference
print header only if there are results...
Land #3538, SAP fix from @jvazquez-r7

This looks good to me, the whole print statement is enclosed in a check
for results.