Fixing location entity does not exist

This commit is contained in:
stephb9959
2021-10-20 13:21:26 -07:00
parent 63101e5211
commit 994f34ce6e
2 changed files with 2 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ namespace OpenWifi{
std::string MoveFromEntity,MoveToEntity;
bool MovingEntity=false;
if(AssignIfPresent(RawObject,"entity",MoveToEntity)) {
if(!MoveToEntity.empty() || !Storage()->EntityDB().Exists("id",MoveToEntity)) {
if(!MoveToEntity.empty() && !Storage()->EntityDB().Exists("id",MoveToEntity)) {
return BadRequest(RESTAPI::Errors::EntityMustExist);
}
MoveFromEntity = Existing.entity;