From dccc1c45c2e54eeb36694a62b7cbd1c4dfd89aa4 Mon Sep 17 00:00:00 2001 From: "stan.donarise" Date: Wed, 27 Mar 2024 04:10:25 +1100 Subject: [PATCH] error for empty data --- matinfio/matinfio.web.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/matinfio/matinfio.web.ts b/matinfio/matinfio.web.ts index 72d311f..c909894 100644 --- a/matinfio/matinfio.web.ts +++ b/matinfio/matinfio.web.ts @@ -63,6 +63,8 @@ namespace $ { /** Guessing what to do */ static detect_format( data: any ) { + + if( !data ) throw new Error("Crystal data is empty"); if( typeof data === 'object' ) return 'OPTIMADE'