Skip to content

Commit

Permalink
Fixed crashed when no profile returned for player
Browse files Browse the repository at this point in the history
  • Loading branch information
mikechambers committed Jan 26, 2024
1 parent abf6b13 commit def08f3
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 19 deletions.
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# dcli Release Notes

## v0.99.8 January 26, 2024

- Fixed crash when adding player with no player profiles.

## v0.99.7 January 26, 2024

- Added support for Iron Banner Fortress (iron_banner_fortress)
Expand Down
18 changes: 9 additions & 9 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/dcli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dcli"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
edition = "2018"
description = "Library for the dcli collection of command line tools for Destiny 2."
Expand Down
4 changes: 4 additions & 0 deletions src/dcli/src/apiinterface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ impl ApiInterface {
//TODO: should we have an error here if no profiles are returned?
//that should not happen

if linked_profiles.profiles.is_empty() {
return Err(Error::NoProfilesFound);
}

let mut most_recent: &DestinyProfileUserInfoCard =
&linked_profiles.profiles[0];

Expand Down
4 changes: 4 additions & 0 deletions src/dcli/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub enum Error {
ActivityNotFound,
DateTimePeriodOrder,
BungieNameNotFound,
NoProfilesFound,
InvalidArgument { description: String },
}

Expand Down Expand Up @@ -170,6 +171,9 @@ impl Display for Error {
Error::BungieNameNotFound => {
write!(f, "Bungie name not found.")
},
Error::NoProfilesFound => {
write!(f, "No player profiles found.")
},
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dclia/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dclia"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
description = "Command line tool for retrieving information on current activity for specified player character."
homepage = "https://www.mikechambers.com"
Expand Down
2 changes: 1 addition & 1 deletion src/dcliad/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dcliad"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
edition = "2018"
description = "Command line tool for viewing Destiny 2 activity details."
Expand Down
2 changes: 1 addition & 1 deletion src/dcliah/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dcliah"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
edition = "2018"
description = "Command line tool for viewing Destiny 2 activity history."
Expand Down
2 changes: 1 addition & 1 deletion src/dclif/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dclif"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
edition = "2018"
description = "Command line tool for querying specific Destiny 2 pvp stats."
Expand Down
2 changes: 1 addition & 1 deletion src/dclim/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dclim"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
edition = "2018"
description = "Command line tool for managing and syncing the remote Destiny 2 API manifest database."
Expand Down
2 changes: 1 addition & 1 deletion src/dclistat/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dclistat"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
edition = "2018"
description = "Command line tool for querying specific Destiny 2 pvp stats."
Expand Down
2 changes: 1 addition & 1 deletion src/dclisync/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dclisync"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
edition = "2018"
description = "Command line tool for downloading and syncing Destiny 2 Crucible activity history."
Expand Down
2 changes: 1 addition & 1 deletion src/dclitime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dclitime"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
edition = "2018"
description = "Command line tool for retrieving Destiny 2 related date / time stamps"
Expand Down
2 changes: 1 addition & 1 deletion src/tell/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tell"
#version
version = "0.99.7"
version = "0.99.8"
authors = ["Mike Chambers <[email protected]>"]
edition = "2018"
description = "Simple library for handling different levels of user output for command line apps."
Expand Down

0 comments on commit def08f3

Please sign in to comment.