Skip to content

Commit

Permalink
Fix json parse error causing popup
Browse files Browse the repository at this point in the history
  • Loading branch information
bitknox committed May 28, 2023
1 parent 1fb67ab commit 74d1c26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gosumemory/message_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
use super::status_message::StatusMessage;

pub fn handle_update_message(message: Message, token: &str) -> Result<(), OsuNPError> {
let message: StatusMessage = serde_json::from_str(message.to_text()?).unwrap();
let message: StatusMessage = serde_json::from_str(message.to_text()?)?;

let currently_playing = NowPlaying {
token: token.to_string(),
Expand All @@ -26,5 +26,6 @@ pub fn handle_update_message(message: Message, token: &str) -> Result<(), OsuNPE
.as_millis(),
};
send_update_reqeust(currently_playing)?;

Ok(())
}

0 comments on commit 74d1c26

Please sign in to comment.