Commit 4b84385d authored by mtomasz's avatar mtomasz Committed by Commit bot

Fix refreshing the volume list when the volume is unmounted.

When a volume is unmounted, while it was selected, then the list model is
updated, and since there is no selection anymore, the current entry from the
directory model is selected. However, the corresponding VolumeInfo is gone
so we can't call resolveRootEntry().

This patch adds a check. If the volume is gone, then the selection is aborted.

TEST=Tested manually with FSP.
BUG=418513

Review URL: https://codereview.chromium.org/595903003

Cr-Commit-Position: refs/heads/master@{#297188}
parent 328fbe55
...@@ -1018,6 +1018,8 @@ DirectoryTree.prototype.selectByEntry = function(entry) { ...@@ -1018,6 +1018,8 @@ DirectoryTree.prototype.selectByEntry = function(entry) {
this.updateSubDirectories(false /* recursive */); this.updateSubDirectories(false /* recursive */);
var currentSequence = ++this.sequence_; var currentSequence = ++this.sequence_;
var volumeInfo = this.volumeManager_.getVolumeInfo(entry); var volumeInfo = this.volumeManager_.getVolumeInfo(entry);
if (!volumeInfo)
return;
volumeInfo.resolveDisplayRoot(function() { volumeInfo.resolveDisplayRoot(function() {
if (this.sequence_ !== currentSequence) if (this.sequence_ !== currentSequence)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment