dotnet / dotnet/XAMLStudio

NullReferenceExceptions if using the main menus with no document open

Open
#56 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
C#
Stars
450
Forks
46
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

Some of the main menu options assume that there is always a document open and will throw `NullReferenceException`s 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

```text
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)
- [x] 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.