throw an explicit exception when passed a null entity to save().
fixes #477