Some safe coding. Check that pointer is not null.