Skip to content

Fix: Potential "setState() called after dispose()" crash in _fetchChangelog() #34

@Miduo666

Description

@Miduo666

Describe the Bug

In version_widget-1.0.6/lib/src/widgets/version_widget.dart, the _fetchChangelog() method contains 4 instances of setState() that lack the if (mounted) guard.

On the Web platform, if an HTTP request is initiated and the widget is disposed of (e.g., due to page navigation or hot reload) before the request completes, any subsequent call to setState()—especially within the catch block—will trigger a Flutter framework assertion:
!_debugLifecycleState → Null check operator used on a null value.

Context

Where has the issue been observed:

  • Android
  • Chrome
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

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