NullReferenceExceptions if using the main menus with no document open

Open
#56 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
desktop

Research direction

Start by launching the app with no documents open and exercise the Data and Properties entries in the left menu to reproduce the exceptions. Trace those menu entry points to identify where the no-document case is handled, then verify that both actions complete without exceptions when no document is open.

Written by the indexing model from the issue text.

Description

bug
Describe the bug

Some of the main menu options assume that there is always a document open and will throw NullReferenceExceptions if clicked when there isn't.

It doesn't make for a great first experience if people are just clicking around to explore the interface.

Steps to reproduce
1. Launch the app for the first time (no documents open)
2a. Click "Data" in the left menu
2b. Or click "Properties" in the left menu
3. Get a NullReferenceException
Expected behavior

No exceptions.

These cases should be handled without problems.

Screenshots

No response

Windows Build Number
  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 10 21H2 (Build 19044)
  • Windows 10 22H2 (Build 19045)
  • Windows 11 21H2 (Build 22000)
  • Windows 11 22H2 (Build 22621)
  • Windows 11 23H2 (Build 22631)
  • Windows 11 24H2 (Build 26100)
  • Windows 11 25H2 (Build 26200)
  • Windows 11 26H1 (Build 28000)
  • Other (specify)
Other Windows Build number

No response

Additional context

PR with fixes to follow.

Help us help you

Yes, I'd like to be assigned to work on this item.

Dominant language
C#
Stars
450
Forks
47
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/XAMLStudio

All issues in dotnet/XAMLStudio

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.