checked for channel size to avoid crash when printing channel overview

This commit is contained in:
Vishal 2022-11-07 13:16:05 +05:30
parent 7343a58320
commit deac0aa1c4
2 changed files with 5 additions and 5 deletions

View File

@ -1335,6 +1335,10 @@ class Store {
channelstoPrint.sort(scrollableCompareTo);
int numChannelsActuallyPrinted = 0;
if( channelstoPrint.length < numRoomsOverview) {
numRoomsOverview = channelstoPrint.length;
}
print("\n\n");
printUnderlined(" Channel Name Num of Messages Latest Message ");
for(int j = 0; j < numRoomsOverview; j++) {

View File

@ -4,11 +4,7 @@ version: 0.1.0-beta
homepage: https://github.com/vishalxl/nostr_console
# Release 0.1.0-beta - encrypted channels; fixes
# improved fetching of events. and display for channels.
# damus reactions
# random seed
# printed info
# added delay
# crash channel overview
environment:
sdk: '>=2.17.3 <3.0.0'