thread 'main' panicked at /home/imxeren/.cargo/git/checkouts/grammers-b702bdb11c87df45/e4116c7/lib/grammers-client/src/client/files.rs:37:87:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
On update handler, the method panics if the media isn't downloadable for example, in case of polls etc. Looking on the description,
Download the message media in this message if applicable.
Returns true if there was media to download, or false otherwise.
I guess that it shouldn't panic and return an Err and ultimately returns false on message.download_media().
Possible Solution
On navigating, I notice that the issue is how the method handles the download by invoking downloadable.to_input_location() which returns None. So, a check inside the fn download_media and returns Err if downloadable.to_input_location() is None, can possibly fix this.
Issue
On update handler, the method panics if the media isn't downloadable for example, in case of polls etc. Looking on the description,
I guess that it shouldn't panic and return an
Err
and ultimately returns false onmessage.download_media()
.Possible Solution
On navigating, I notice that the issue is how the method handles the download by invoking
downloadable.to_input_location()
which returnsNone
. So, a check inside thefn download_media
and returnsErr
ifdownloadable.to_input_location()
isNone
, can possibly fix this.