Browse Source

handle empty HEADER record

Yana Rose 2 years ago
parent
commit
59f881c4be
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/mol-model-formats/structure/pdb/header.ts

+ 3 - 3
src/mol-model-formats/structure/pdb/header.ts

@@ -25,7 +25,7 @@ export function addHeader(data: string, s: number, e: number, header: PdbHeaderD
     // idCode  	          _entry.id
 
     const line = data.substring(s, e);
-    header.id_code = line.substring(62, 66);
-    header.dep_date = line.substring(50, 59);
-    header.classification = line.substring(10, 50).trim();
+    header.id_code = line.substring(62, 66).trim() || undefined;
+    header.dep_date = line.substring(50, 59).trim() || undefined;
+    header.classification = line.substring(10, 50).trim() || undefined;
 }