rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.91k stars 299 forks source link

Resolver Error on JsonConverter #6202

Closed DistrictOperator closed 7 months ago

DistrictOperator commented 7 months ago

Rubberduck version information The info below can be copy-paste-completed from the first lines of Rubberduck's log or the About box:

Version 2.5.9.6316 OS: Microsoft Windows NT 10.0.22621.0, x64 Host Product: Microsoft Office x64 Host Version: 16.0.17328.20068 Host Executable: EXCEL.EXE

Description I get a resolver error. The log shows this:

2024-02-16 15:23:57.9251;ERROR-2.5.9.6316;Rubberduck.Common.LogLevelHelper;
    Rubberduck version 2.5.9.6316 loading:
    Operating System: Windows 10 Home 2009 x64 (Microsoft Windows NT 10.0.22621.0)
    Host Product: Microsoft Office x64
    Host Version: 16.0.17328.20068
    Host Executable: EXCEL.EXE;
2024-02-16 15:24:14.4902;ERROR-2.5.9.6316;Rubberduck.Parsing.VBA.ReferenceManagement.ReferenceResolveRunnerBase;Exception thrown resolving 'VBAProject.JsonConverter' (thread 23).;System.NullReferenceException: Object reference not set to an instance of an object.
   at Rubberduck.Parsing.VBA.ReferenceManagement.IdentifierReferenceResolver.Resolve(SingleLineIfStmtContext context)
   at Rubberduck.Parsing.Grammar.VBAParser.SingleLineIfStmtContext.EnterRule(IParseTreeListener listener)
   at Antlr4.Runtime.Tree.ParseTreeWalker.Walk(IParseTreeListener listener, IParseTree t)
   at Rubberduck.Parsing.VBA.ReferenceManagement.ReferenceResolveRunnerBase.ResolveReferences(DeclarationFinder finder, QualifiedModuleName module, IParseTree tree, CancellationToken token)

To Reproduce Install the excellent JsonConverter found here: https://github.com/VBA-tools/VBA-JSON

And then try starting Excel with Rubberduck, or loading it via the Addin Manager.

Expected behavior Expected Rubberduck to go ahead and parse and resolve the VBA.

Screenshots n/a

Logfile See above.

Additional context Love Rubberduck!

tommy9 commented 7 months ago

Hi, thanks for reporting the issue. It looks like one that was fixed a few weeks ago. If you can try upgrading to the latest pre-release version https://github.com/rubberduck-vba/Rubberduck/releases, that should hopefully work.

DistrictOperator commented 7 months ago

Wow, thank you so much! Totally fixed it.
Thanks for the great work. I am a hobbyist and do stuff for non-profits and I really appreciate what you all are doing for the world of VBA.