mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps_container] Avoid crashing on ×10^ on N0100
This commit is contained in:
@@ -34,6 +34,11 @@ App::Snapshot * AppsContainerStorage::appSnapshotAtIndex(int index) {
|
||||
};
|
||||
assert(sizeof(snapshots)/sizeof(snapshots[0]) == k_numberOfCommonApps);
|
||||
assert(index >= 0 && index < k_numberOfCommonApps);
|
||||
// To avoid crashes, we return the home app snapshot if the index is out of
|
||||
// bounds. (no crash in release mode, but an assert in debug mode)
|
||||
if (index >= k_numberOfCommonApps) {
|
||||
return snapshots[0];
|
||||
}
|
||||
return snapshots[index];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user