Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Null Reference exception in Solution Explorer context menu #324

@dcastenholz

Description

@dcastenholz

I found an edge case where the Solution Explorer context menu for 'Generate Code' can cause a null reference exception. Happens only before the extension is loaded, so it is rare. Steps to reproduce are:

  1. Load solution with .efmodel file in it.
  2. Immediately right-click on .efmodel file and select 'Generate Code'.

Fix:

      private void OnMenuSolutionExplprerGenerateCode(object sender, EventArgs e)
      {
         if (solutionExplorerSelectedFileInfo == null)
         {
            solutionExplorerSelectedFileInfo = new FileInfo(CommandHelper.GetSingleFileSelectedPath());
         }

         CommandHelper.GenerateCode(solutionExplorerSelectedFileInfo.FullName);
      }

in DslPackage\CustomCode\CommandSet.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions