prevent NPE in MMS logic

Fixes #1434