MV Yanfly Message Backlog producing error "Cannot read property 'iconIndex' of undefined"

Hi!

I just installed Yanfly's Message Backlog plugin, and it's causing an error.

If an event brings up a "Select Item", and I don't have any items, RPG Maker brings up a blank screen, gives me the options to choose a null item, and I can go from there. That's fine, that's default behavior.

But with the Message Backlog plugin, when selecting a null item, I get "Cannot read property 'iconIndex' of undefined"

Console points to the plugin, confirmed it's the plugin by turning it off, and moving it around doesn't change things.

I can't parse the plugin at my skill level, but it makes sense that for the purposes of logging, it's trying to store the icon index of an item that doesn't exist.

I can clear the error by turning off logging on "special inputs", but I'd love to not have to do that.

It's a paid plugin so I don't want to paste it here obviously, and my understanding is that Yanfly is no longer supporting these plugins.

But if anyone out there is familiar with the (otherwise amazing) plugin, any thoughts?

Thank you!! :LZSsmile::LZSsmile::LZSsmile:
Maybe try saving this as a .js file and loading it after YEP_X_MessageBacklog:
JavaScript:
/*:
 * @target MV
 * @plugindesc Patches YEP Message Backlog - prevent error on selecting null item.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/159752/
 * @help Load this plugin after YEP_X_MessageBacklog.
 *
 * Free to use and/or modify for any project, no credit required.
 */
;void (function(alias) {
  Window_EventItem.prototype.backlogAddSelectedChoice = function() {
    if (this.item())  // only if item is truthy
      alias.apply(this, arguments);
  };
})(Window_EventItem.prototype.backlogAddSelectedChoice);
Maybe try saving this as a .js file and loading it after YEP_X_MessageBacklog:
JavaScript:
/*:
 * @target MV
 * @plugindesc Patches YEP Message Backlog - prevent error on selecting null item.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/159752/
 * @help Load this plugin after YEP_X_MessageBacklog.
 *
 * Free to use and/or modify for any project, no credit required.
 */
;void (function(alias) {
  Window_EventItem.prototype.backlogAddSelectedChoice = function() {
    if (this.item())  // only if item is truthy
      alias.apply(this, arguments);
  };
})(Window_EventItem.prototype.backlogAddSelectedChoice);

Lol you have got to be kidding, @caethyril -- of course this works perfectly.

You are unreal, what would we do without you, thank you so, so much!!! :LZScheeze::LZScheeze::LZScheeze:
This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-message-backlog-producing-error-cannot-read-property-iconindex-of-undefined.159752/