core/msg: prevent null pointer dereference

- [x] needs checking for new return value compatibility
- [x] `printf` needs removing