| Index: chrome/browser/chromeos/drive/resource_metadata.cc
|
| diff --git a/chrome/browser/chromeos/drive/resource_metadata.cc b/chrome/browser/chromeos/drive/resource_metadata.cc
|
| index 0b1b6e9c4c6a45b0caf04f64056ae97fea2be993..e6972bf67fbcbce282a04a2bf3c993a6b5159d4f 100644
|
| --- a/chrome/browser/chromeos/drive/resource_metadata.cc
|
| +++ b/chrome/browser/chromeos/drive/resource_metadata.cc
|
| @@ -447,12 +447,14 @@ FileError ResourceMetadata::RefreshEntry(const ResourceEntry& entry) {
|
| entry.file_info().is_directory())
|
| return FILE_ERROR_INVALID_OPERATION;
|
|
|
| - // Update data.
|
| + // Make sure that the new parent exists and it is a directory.
|
| ResourceEntry new_parent;
|
| - if (!storage_->GetEntry(entry.parent_local_id(), &new_parent) ||
|
| - !new_parent.file_info().is_directory())
|
| + if (!storage_->GetEntry(entry.parent_local_id(), &new_parent))
|
| return FILE_ERROR_NOT_FOUND;
|
|
|
| + if (!new_parent.file_info().is_directory())
|
| + return FILE_ERROR_NOT_A_DIRECTORY;
|
| +
|
| // Remove from the old parent and add it to the new parent with the new data.
|
| if (!PutEntryUnderDirectory(entry))
|
| return FILE_ERROR_FAILED;
|
|
|