Jump to content

Unhandled exception when importing set from clipboard after opening Gen I save file


BeyondTheHorizon

Recommended Posts

Hi,

When I went to import a Gen I moveset from the clipboard, PKHeX gave an unhandled exception. The moveset was as follows:

Mew
Level: 5
EVs: 1 HP / 1 Atk / 1 Def / 1 SpA / 1 SpD / 1 Spe
- Cut
- Fly
- Surf
- Strength

The exception was as follows:

Exception Details:
System.NullReferenceException: Object reference not set to an instance of an object.
   at PKHeX.Core.CommonEdits.ApplySetDetails(PKM pk, ShowdownSet Set)
   at PKHeX.WinForms.Controls.PKMEditor.LoadShowdownSetDefault(ShowdownSet Set)
   at PKHeX.WinForms.Main.ClickShowdownImportPKM(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Loaded Assemblies:
--------------------
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll

PKHeX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
D:\Robert's Folder\Games\Hacking Tools\Pokémon\PKHeX\PKHeX.exe

System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll

System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll

System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll

PKHeX.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
D:\Robert's Folder\Games\Hacking Tools\Pokémon\PKHeX\PKHeX.Core.dll

System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll

System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll

System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll

--------------------
User Message:
An unhandled exception has occurred.
You can continue running PKHeX, but please report this error.

Hope this can be fixed. Thank you for reading.

EDIT: I rushed this post and didn't explain that the exception occurs when importing the set from within a Gen I save file. I can confirm it imports without an exception within a Gen II save file, as well as when one imports the set before loading a save file.

Edited by BeyondTheHorizon
Added further information
Link to comment
Share on other sites

I should have explained in the original post that I was attempting to import the set after opening a Yellow save file. I think when I wrote "Gen I moveset", I assumed people would know that I did that. Silly me. It indeed imports without an exception if I import the set immediately after opening PKHeX. It also imports without an exception after opening a Crystal save file.

Link to comment
Share on other sites

  • BeyondTheHorizon changed the title to Unhandled exception when importing set from clipboard after opening Gen I save file

Aha! I think I've found the problem. It raises an exception if I import in Yellow when either the Pokémon's Level is illegal or—in the case of Mew—can't legally be obtained in-game (without the infamous Mew glitch). I have also discovered that Gen 2 tradebacks must also be set to "Yes" for exceptions to occur. For example, this moveset…

Mewtwo
Level: 70
- Swift
- Psychic
- Barrier
- Recover

…imports without an exception. However, this moveset…

Mewtwo
Level: 69
- Disable
- Swift
- Psychic
- Barrier

…raises an exception because it is impossible to obtain a Mewtwo below Level 70 legally in Gen I. It should be able to import and then let you know its Level isn't legal.

I hope this helps.

Link to comment
Share on other sites

7 minutes ago, BeyondTheHorizon said:

I did, but it still throws the error. Ugh! Nobody else can reproduce it, so it can't be a PKHeX problem. I wonder if it's a .NET problem.

I know how frustrating that must be.

In the mean time, maybe use a few different older revisions, and see if there's any version that doesn't throw the error for you.

Link to comment
Share on other sites

29 minutes ago, theSLAYER said:

In the mean time, maybe use a few different older revisions, and see if there's any version that doesn't throw the error for you.

Okay, I've cloned PKHeX into a separate folder I called PKHeX-git, and used git --reset hard <commit> to obtain older versions of PKHeX. I have discovered that the 18.06.01 version of PKHeX imports sets without throwing errors, but all later stable versions of PKHeX do.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...