File tree Expand file tree Collapse file tree
dConnectDevicePlugin/dConnectDeviceHost/dConnectDeviceHost/Classes/profile Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments