fix(server/vehicle): vehicle not saving to db if no coords passed (#208)#210
fix(server/vehicle): vehicle not saving to db if no coords passed (#208)#210thelindat merged 3 commits intooverextended:mainfrom andreutu:main
Conversation
|
I think this requires some more further changes. The docs state that this method should return an instance of OxVehicle. This PR would still return null in the instance where the vehicle entity is not created (no coords). I think we should try to return that OxVehicle instance and fix some of the problems that exist in the constructor for when the entity isn't provided. |
|
The change I've done just skips past the entity validation checks when no coords are passed. If no coords are passed, then the vehicle should automatically be stored in the database under the specified owner. The DB saving process didn't occur before modifying the code, as, without coords, the entity automatically gets assigned to If you meant that this function, regardless of whether the code was modified or not, does not return an OxVehicle object, then that's another issue that should be addressed in a separate issue. |
|
I've opened an issue for it #212 |
|
This line should actually just be removed as there's an entity check (though missing DoesEntityExist) occurring after database insertion / before OxVehicle instantiation. |
only entity check remains after database insertion
|
I have done the necessary changes, the only entity check that remains is the one after the database validation. |
Should solve the issue that was reported a few days ago. All that is changed is to check whether coords exist before returning if the entity does not.