Avoid a crash when disabling a non-enabled extension with load errors.

Review Request #11926 — Created Jan. 11, 2022 and submitted

chipx86
Djblets
release-2.x
djblets

disable_extension() made an assumption that it should always send an
extension_disabled() signal, and that it always had an extension
object to pass in.

If the extension being disabled was never enabled but had a load error,
this assumption would break. This is a pretty obscure case, but one that
was hit with some test work.

We now set extension to None in this case, and only emit the signal
if not None.

Unit tests pass.

Verified this fixed the issue I was hitting in upcoming test changes.

Summary
Avoid a crash when disabling a non-enabled extension with load errors.
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.x (d8340c3)
Loading...