Skip to content

Commit

Permalink
CORE / add check if bonjour_domain is not a string
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-ev committed Apr 21, 2024
1 parent fd4492f commit bdc0f12
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions core2/main2.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,23 @@ module.exports = async function () {
server();

if (global.settings.bonjour_domain !== false) {
await require("./bonjour").init({
name: "do•doc",
protocol: global.settings.protocol,
port: global.appInfos.port,
host: global.settings.bonjour_domain,
});
if (typeof global.settings.bonjour_domain !== "string") {
if (is_electron) {
const { dialog } = require("electron");
dialog.showErrorBox(
`Impossible de démarrer l’application`,
`Le domaine Bonjour doit être une chaîne de caractères.`
);
}
throw new Error("Le domaine Bonjour doit être une chaîne de caractères.");
} else {
await require("./bonjour").init({
name: "do•doc",
protocol: global.settings.protocol,
port: global.appInfos.port,
host: global.settings.bonjour_domain,
});
}
}

if (is_electron) {
Expand Down

0 comments on commit bdc0f12

Please sign in to comment.