Skip to content

Commit 42848ae

Browse files
committed
feat: add try catch for charge
1 parent ad24450 commit 42848ae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

inst/rawrrassembly/rawrr.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,15 @@ public static void WriteSpectrumAsRcode(this IRawDataPlus rawFile, string filena
457457
else
458458
file.WriteLine("\tmonoisotopicMz = NA,");
459459

460+
// file.WriteLine("## DEBUG indexCharge={0} {1}", indexCharge, scanTrailer.Values.ToArray()[indexCharge]);
460461

461-
if (indexCharge > 0)
462+
if (indexCharge > 0){
463+
try{
462464
file.WriteLine("\tcharge = {0},", int.Parse(scanTrailer.Values.ToArray()[indexCharge]));
465+
} catch {
466+
file.WriteLine("\tcharge = NA,");
467+
}
468+
}
463469
else
464470
file.WriteLine("\tcharge = NA,");
465471

0 commit comments

Comments
 (0)