From dece4734baf23822d7199016f9908a24c566dc3b Mon Sep 17 00:00:00 2001 From: Mateusz Paprocki Date: Thu, 14 Apr 2022 08:42:01 +0200 Subject: [PATCH] Don't fail on an empty `` --- pyscriptjs/src/components/pyenv.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyscriptjs/src/components/pyenv.ts b/pyscriptjs/src/components/pyenv.ts index f67b808..c2f964c 100644 --- a/pyscriptjs/src/components/pyenv.ts +++ b/pyscriptjs/src/components/pyenv.ts @@ -39,7 +39,11 @@ export class PyEnv extends HTMLElement { let env = []; let paths = []; + this.environment = jsyaml.load(this.code); + if (this.environment === undefined) + return + for (let entry of this.environment) { if (typeof entry == "string" ){ env.push(entry);