Crash related to Window_MapName

I've run across a weird crash, which I'm not sure what's causing it. If I use the transfer function to move the player to a different part of a map, it gives me a "no method error" crash.

nomethoderror map name.png
Regardless of what script you're using, try to add this patch. It should be safe to be placed anywhere on your script list.
Code:
class Game_Map
  def display_name
    @map.display_name || ""
  end
end
Regardless of what script you're using, try to add this patch. It should be safe to be placed anywhere on your script list.
Code:
class Game_Map
  def display_name
    @map.display_name || ""
  end
end
That worked! Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/crash-related-to-window_mapname.122748/