|
@@ -120,8 +120,10 @@ public class FoodServiceImpl implements FoodService {
|
|
|
return SendUtil.send(false, ConstStr.UPDATEUSER_FAILED, "");
|
|
|
}
|
|
|
File oldFile = new File(location + sFile.getPath());
|
|
|
- if (!oldFile.delete()) {
|
|
|
- return SendUtil.send(false, ConstStr.UPDATEUSER_FAILED, "");
|
|
|
+ if (oldFile.exists()) {
|
|
|
+ if (!oldFile.delete()) {
|
|
|
+ return SendUtil.send(false, ConstStr.UPDATEUSER_FAILED, "");
|
|
|
+ }
|
|
|
}
|
|
|
newPicList.remove(s);
|
|
|
i--;
|
|
@@ -218,8 +220,10 @@ public class FoodServiceImpl implements FoodService {
|
|
|
return SendUtil.send(false, ConstStr.DELETEUSER_FAILED, "");
|
|
|
}
|
|
|
File oldFile = new File(location + stringObjectMap.get("path"));
|
|
|
- if (!oldFile.delete()) {
|
|
|
- return SendUtil.send(false, ConstStr.DELETEUSER_FAILED, "");
|
|
|
+ if (oldFile.exists()) {
|
|
|
+ if (!oldFile.delete()) {
|
|
|
+ return SendUtil.send(false, ConstStr.DELETEUSER_FAILED, "");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|