fix: don't observe WebUSB for in-memory partitions (#42461)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
95e2105283
commit
987e1828d6
2 changed files with 4 additions and 3 deletions
|
@ -46,8 +46,8 @@ class ElectronHidDelegate::ContextObservation
|
|||
ContextObservation(ElectronHidDelegate* parent,
|
||||
content::BrowserContext* browser_context)
|
||||
: parent_(parent), browser_context_(browser_context) {
|
||||
auto* chooser_context = GetChooserContext(browser_context_);
|
||||
device_observation_.Observe(chooser_context);
|
||||
if (auto* chooser_context = GetChooserContext(browser_context_))
|
||||
device_observation_.Observe(chooser_context);
|
||||
}
|
||||
|
||||
ContextObservation(ContextObservation&) = delete;
|
||||
|
|
|
@ -94,7 +94,8 @@ class ElectronUsbDelegate::ContextObservation
|
|||
content::BrowserContext* browser_context)
|
||||
: parent_(parent), browser_context_(browser_context) {
|
||||
auto* chooser_context = GetChooserContext(browser_context_);
|
||||
device_observation_.Observe(chooser_context);
|
||||
if (chooser_context)
|
||||
device_observation_.Observe(chooser_context);
|
||||
}
|
||||
ContextObservation(ContextObservation&) = delete;
|
||||
ContextObservation& operator=(ContextObservation&) = delete;
|
||||
|
|
Loading…
Reference in a new issue