Commit 251cbd3 1 parent 87714bf commit 251cbd3 Copy full SHA for 251cbd3
File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,6 @@ export async function CreateVehicle(
62
62
: await OxVehicle . generatePlate ( ) ;
63
63
64
64
const metadata = data . data || ( { } as { properties ?: VehicleProperties ; [ key : string ] : any } ) ;
65
- const properties = data . properties || metadata . properties || ( { } as VehicleProperties ) ;
66
- delete metadata . properties ;
67
65
68
66
if ( ! data . id && data . vin ) {
69
67
data . id = await CreateNewVehicle (
@@ -78,7 +76,10 @@ export async function CreateVehicle(
78
76
) ;
79
77
}
80
78
81
- if ( ! entity ) return ;
79
+ if ( ! entity || ! DoesEntityExist ( entity ) ) return ;
80
+
81
+ const properties = data . properties || metadata . properties || ( { } as VehicleProperties ) ;
82
+ delete metadata . properties ;
82
83
83
84
return new OxVehicle (
84
85
entity ,
You can’t perform that action at this time.
0 commit comments