Skip to content

Remove two more unnecessary-check patterns; bump to v1.0.6 - #6

Merged
urhend merged 1 commit into
mainfrom
production
Aug 1, 2026
Merged

urhend merged 1 commit into
mainfrom
production

Conversation

@urhend

@urhend urhend commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove e instanceof GLib.Error guard in runCommand() — proc.init() only ever throws GLib.Error given our controlled argv, so the check was dead weight, same category as the reviewer-flagged _destroyed flag
  • Remove optional chaining on this._networkNameLabel in _maybeNotifyStateChange — guaranteed non-null at that call site since _buildMenu() always runs before _refresh() can reach it
  • Bump version-name to 1.0.6

Test plan

  • node --check extension.js
  • metadata.json JSON validation
  • CI

- Drop `e instanceof GLib.Error` guard in runCommand()'s first catch —
  proc.init() only ever throws GLib.Error given our fully-controlled
  argv, so the check never does anything. The sibling catch block a few
  lines down (around communicate_utf8_async) never had this guard,
  which made the asymmetry obvious in hindsight.
- Drop optional chaining on this._networkNameLabel in
  _maybeNotifyStateChange — _buildMenu() always runs before _refresh()
  can reach this code path, so the label is guaranteed to exist.

Same category as the this._destroyed flag removed in dca6371: a
defensive check written for a case that can't actually happen at its
call site.
@urhend
urhend merged commit ff70305 into main Aug 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant