From 7e6fc307426a0b21e246db05262c7124d5339436 Mon Sep 17 00:00:00 2001 From: Quentin Roussel Date: Mon, 2 Jan 2023 19:42:18 +0100 Subject: [PATCH] =?UTF-8?q?fix=20verification=20types=20de=20donn=C3=A9es?= =?UTF-8?q?=20Les=20verification=20de=20types=20dans=20les=20structures=20?= =?UTF-8?q?de=20donn=C3=A9es=20=C3=A9taient=20toujours=20pass=C3=A9es=20a?= =?UTF-8?q?=20cause=20d'un=20oubli=20de=20parenth=C3=A8ses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/server/borne/structures.js | 2 +- code/server/reseaux_sociaux/structures.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/server/borne/structures.js b/code/server/borne/structures.js index 4dcdceb..d9fab3e 100644 --- a/code/server/borne/structures.js +++ b/code/server/borne/structures.js @@ -27,7 +27,7 @@ export class Review { throw new Error("Note " + notesAutre[nom] +"/10 invalide"); } } - if(!auteur instanceof Auteur) { + if(!(auteur instanceof Auteur)) { throw new Error("L'auteur est invalide"); } } diff --git a/code/server/reseaux_sociaux/structures.js b/code/server/reseaux_sociaux/structures.js index d3ca251..adcbbb0 100644 --- a/code/server/reseaux_sociaux/structures.js +++ b/code/server/reseaux_sociaux/structures.js @@ -14,7 +14,7 @@ export class ReseauxReview extends Review{ super(auteur,note,source,commentaire); this.lien = lien; this.date = date; - if(!lien instanceof String && lien != null) { + if(!(lien instanceof String && lien != null)) { throw new Error("Lien invalide"); } } @@ -32,7 +32,7 @@ export class ReseauxAuteur { this.source = source; this.lien = lien; - if(!this.nom instanceof String || !this.source instanceof String || !this.lien instanceof String) { + if(!(this.nom instanceof String) || !(this.source instanceof String) || !(this.lien instanceof String)) { throw new Error("Auteur invalide"); } }