We should check that jmg is not nullptr and return false if it is.