Really sorry 8). You're not checking for the null ptr of g_mk here - but the above if condition gets you there if g_mk == null.