- if (msgindex > 0 && edit (msgbuf, msgindex) >= 0) {
- if (!possible_mmc (msgbuf, msgindex) || _mmc_forward) {
- if (!possible_mtc (msgbuf, msgindex) || _mtc_forward) {
- if (!_offline) {
- sysex (*this, msgbuf, msgindex);
+ if (msgindex > 0) {
+
+ boost::optional<int> res = edit (msgbuf, msgindex);
+
+ if (res.get_value_or (1) >= 0) {
+ if (!possible_mmc (msgbuf, msgindex) || _mmc_forward) {
+ if (!possible_mtc (msgbuf, msgindex) || _mtc_forward) {
+ if (!_offline) {
+ sysex (*this, msgbuf, msgindex);
+ }