Skip to content

Commit

Permalink
🐛 Return if session is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Androz2091 committed Oct 10, 2020
1 parent e9a0149 commit dfb6993
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ const pronoteSynchronization = async () => {

// Connexion à Pronote
const cas = (process.env.PRONOTE_CAS && process.env.PRONOTE_CAS.length > 0 ? process.env.PRONOTE_CAS : "none");
const session = await pronote.login(process.env.PRONOTE_URL, process.env.PRONOTE_USERNAME, process.env.PRONOTE_PASSWORD, cas, "student");
const session = await pronote.login(process.env.PRONOTE_URL, process.env.PRONOTE_USERNAME, process.env.PRONOTE_PASSWORD, cas, "student").catch(console.log);
if (!session) return;

// Vérification des devoirs
const homeworks = await session.homeworks(Date.now(), DATE_END_OF_YEAR);
Expand Down

0 comments on commit dfb6993

Please sign in to comment.