1
mirror of https://github.com/thepeacockproject/Peacock synced 2025-02-16 16:34:28 +01:00

Fix SMF adding contracts to a location that has no contracts yet ()

This commit is contained in:
Govert de Gans 2024-02-02 18:05:26 +01:00 committed by GitHub
parent cf6505ca9a
commit 0585b35447
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,9 +120,8 @@ export class SMFSupport {
const id = contractData.Metadata.Id
const placeBefore = contractData.SMF?.destinations.placeBefore
const placeAfter = contractData.SMF?.destinations.placeAfter
const inLocation = this.controller.missionsInLocations[
location
] as string[]
const inLocation = (this.controller.missionsInLocations[location] ??
(this.controller.missionsInLocations[location] = [])) as string[]
if (placeBefore) {
const index = inLocation.indexOf(placeBefore)