Always check first if a feature is enabled before doing anything else to increase compatibility with other modules

This commit is contained in:
2021-01-27 12:43:47 +01:00
parent 2a9d7e7acb
commit 869fedd128
4 changed files with 10 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ import * as Util from "../util.js"
// Inject settings for synchronized doors
export function onRederWallConfig(wallConfig, html, data) {
if (data.isDoor && game.settings.get(settingsKey, "synchronizedDoors")) {
if (game.settings.get(settingsKey, "synchronizedDoors") && data.isDoor) {
// Inject settings
const synchronizedSettings = `
<p class="notes">${game.i18n.localize("smart-doors.ui.synchronizedDoors.description")}</p>