From 019e34c24d4350e90745b9b9a857c1caee4e844d 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'