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

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

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.

Commits

Files

Loading...