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

Unified Diff: chrome/browser/resources/file_manager/background/js/volume_manager.js

Issue 132633007: Return null in getLocationInfo for Drive files outside of virtual mount points. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up. Created 6 years, 10 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: chrome/browser/resources/file_manager/background/js/volume_manager.js
diff --git a/chrome/browser/resources/file_manager/background/js/volume_manager.js b/chrome/browser/resources/file_manager/background/js/volume_manager.js
index 574459ecc4d91f195615a27698bad475b1527094..c62baa099ce445b841b01ba21251813bf3225ee6 100644
--- a/chrome/browser/resources/file_manager/background/js/volume_manager.js
+++ b/chrome/browser/resources/file_manager/background/js/volume_manager.js
@@ -695,7 +695,9 @@ VolumeManager.prototype.getLocationInfo = function(entry) {
rootType = RootType.DRIVE_OTHER;
isReadOnly = true;
} else {
- throw new Error(entry.fullPath + ' is an invalid drive path.');
+ // Accessing Drive files outside of /drive/root and /drive/other is not
+ // allowed, but can happen. Therefore returning null.
+ return null;
}
} else {
// Otherwise, root path is same with a mount path of the volume.
@@ -714,6 +716,7 @@ VolumeManager.prototype.getLocationInfo = function(entry) {
rootType = RootType.CLOUD_DEVICE;
break;
default:
+ // Programming error, throw an exception.
throw new Error('Invalid volume type: ' + volumeInfo.volumeType);
}
isReadOnly = volumeInfo.isReadOnly;
« 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