Skip to content

Commit 8d1da98

Browse files
[AtModem] Fix Uncaught exception in ModemBase.GetNetworkRegistration() (#1217)
Co-authored-by: Laurent Ellerbach <[email protected]>
1 parent fea4ee8 commit 8d1da98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

devices/AtModem/Modem/ModemBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ public virtual ModemResponse GetNetworkRegistration()
722722

723723
// The first one is the notification level with proactive +CREG
724724
////int n = int.Parse(parts[0]);
725-
int stat = int.Parse(parts[1]);
725+
int stat = parts.Length >= 2 ? int.Parse(parts[1]) : 0;
726726
return ModemResponse.ResultSuccess((NetworkRegistration)stat);
727727
}
728728
}

0 commit comments

Comments
 (0)