Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Unified Diff: ui/file_manager/file_manager/foreground/js/file_transfer_controller.js

Issue 2620923002: Avoid runtime error for some type of entries which don't have volumeInfo. (Closed)
Patch Set: Fix same issue in another place. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
diff --git a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
index 6eba9d64e2d50d77293e065fa60e04dd54bf4456..35ecd10b61ec694a1f9da2a66a4438a4b6fd9a87 100644
--- a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
@@ -1202,10 +1202,11 @@ FileTransferController.prototype.canPasteOrDrop_ =
return false;
var destinationLocationInfo =
this.volumeManager_.getLocationInfo(destinationEntry);
- if (destinationLocationInfo.volumeInfo.error)
- return false;
if (!destinationLocationInfo || destinationLocationInfo.isReadOnly)
return false;
+ if (destinationLocationInfo.volumeInfo &&
+ destinationLocationInfo.volumeInfo.error)
+ return false;
if (!clipboardData.types || clipboardData.types.indexOf('fs/tag') === -1)
return false; // Unsupported type of content.
@@ -1330,7 +1331,8 @@ FileTransferController.prototype.selectDropEffect_ =
this.volumeManager_.getLocationInfo(destinationEntry);
if (!destinationLocationInfo)
return new DropEffectAndLabel(DropEffectType.NONE, null);
- if (destinationLocationInfo.volumeInfo.error)
+ if (destinationLocationInfo.volumeInfo &&
+ destinationLocationInfo.volumeInfo.error)
return new DropEffectAndLabel(DropEffectType.NONE, null);
if (destinationLocationInfo.isReadOnly) {
if (destinationLocationInfo.isSpecialSearchRoot) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698