Skip to content

Commit 94786d9

Browse files
Merge pull request #151 from TakayukiHoshi1984/bugfix_host_move_file
HostデバイスプラグインのPUT /fileの修正
2 parents 388334f + 6909203 commit 94786d9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

dConnectDevicePlugin/dConnectDeviceHost/dConnectDeviceHost/Classes/profile/DPHostFileProfile.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ - (instancetype)init
142142
}
143143
oldPath = [weakSelf removeSlashForPath:oldPath];
144144
newPath = [weakSelf removeSlashForPath:newPath];
145+
if ([oldPath isEqualToString:newPath]) {
146+
[response setErrorToInvalidRequestParameterWithMessage:@"Same file."];
147+
return YES;
148+
}
145149
NSFileManager *sysFileMgr = [NSFileManager defaultManager];
146150
NSError *error;
147151

@@ -295,6 +299,10 @@ - (instancetype)init
295299
}
296300
oldPath = [weakSelf removeSlashForPath:oldPath];
297301
newPath = [weakSelf removeSlashForPath:newPath];
302+
if ([oldPath isEqualToString:newPath]) {
303+
[response setErrorToInvalidRequestParameterWithMessage:@"Same directory."];
304+
return YES;
305+
}
298306
NSFileManager *sysFileMgr = [NSFileManager defaultManager];
299307
NSError *error;
300308

0 commit comments

Comments
 (0)