Menu

#2048 NullReferenceException using Save command

KeePass_2.x
closed
nobody
None
5
2021-05-09
2021-05-09
walterpg1v
No

Plugin ops that set the CustomData properties of both a PwEntry instance and it's containing PwDatabase break the Save command (see attached screenshot).

Also attached, please find a modified copy of the SamplePluginExt.cs source file from "Sample Plugin, v2.20".

The modification adds a few lines to the OnMenuAddEntries method of SamplePlugin.SamplePluginExt, in particular:

pe.CustomData.Set("PluginInfo", "The Entry Info"); pd.CustomData.Set("PluginDbInfo", string.Format("DbInfo Update #{0}", s_cInfo++));

This has been reproduced with KP v2.48 installed on Windows 10 20H2, build 190422.928, with .NET Framework 4.8. KP v2.35, installed on the same system, does not exhibit the behavior.

This is a blocking issue for new and existing plugin releases.

To replicate:
1) Install the modified plugin to a KP v2.48 64-bit installation.
2) Open a database.
3) Invoke the Tools ⇒ SamplePlugin ⇒ Add Some Entries command.
4) Invoke the File ⇒ Save command, either directly or implicitly via the "auto sync" or "save on exit" features.
5) Witness NullReferenceException and message box copied in the attached screenshot.

1 Attachments

Discussion

  • walterpg1v

    walterpg1v - 2021-05-09

    Sorry, the milestone should obviously be KeePass_2.x, and "auto sync" should read "auto lock".

     

    Last edit: walterpg1v 2021-05-09
  • Dominik Reichl

    Dominik Reichl - 2021-05-09

    Thanks a lot for reporting this issue! I've fixed it now.

    Here's the latest development snapshot for testing:
    https://keepass.info/filepool/KeePass_210509.zip

    Please confirm whether it works for you, too.

    Best regards,
    Dominik

     
  • walterpg1v

    walterpg1v - 2021-05-09

    I confirm that the snapshot fixes the issue. Thank you for the quick turnaround.

     
  • Dominik Reichl

    Dominik Reichl - 2021-05-09
    • status: open --> closed
    • Group: KeePass_1.x --> KeePass_2.x
    • Priority: 1 --> 5
     
  • Dominik Reichl

    Dominik Reichl - 2021-05-09

    Great, thanks! KeePass 2.48.1 will be released tomorrow.

    Best regards,
    Dominik

     

Log in to post a comment.