fix crash when selecting some presets (#9738)

This commit is contained in:
Kyℓe Hensel
2023-07-08 01:15:15 +12:00
committed by GitHub
parent 2856a40e85
commit 53a510628c
+1 -1
View File
@@ -312,7 +312,7 @@ export function presetPreset(presetID, preset, addable, allFields, allPresets) {
let parent = allPresets[parentID];
if (loc) {
const validHere = locationManager.locationSetsAt(loc);
if (parent.locationSetID && !validHere[parent.locationSetID]) {
if (parent?.locationSetID && !validHere[parent.locationSetID]) {
// this is a preset for which a regional variant of the main preset exists
const candidateIDs = Object.keys(allPresets).filter(k => k.startsWith(parentID));
parent = allPresets[candidateIDs.find(candidateID => {