Skip to content

Check if Tabs are null in SetDefaultActiveTabAsync #1268

@DrMueller

Description

@DrMueller

Describe the bug
SetDefaultActiveTabAsync accesses the tabs-field, without checking for null. As DisposeAsyncCore does set the tabs to null, this causes a NullReference-exception in cases of exceptions (or if someone would navigate aways fast I guess).

To Reproduce
Steps to reproduce the behavior:

  1. Create a tabs component
  2. Create a content component within the tab
  3. Have the content component throw an exception on OnInitializedAsync

Expected behavior
Tabs component stops gracefully

Screenshots

Image

Versions (please complete the following information):

  • .NET Version: .NET8
  • BlazorBootstrap: 3.4.0
  • Blazor WebAssembly / Server: Server
  • Blazor Interactive Render Mode: Server
  • Blazor Interactivity Location: Global

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions