mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-23 19:55:18 +00:00
fix: KeyNotFoundException
KeyNotFoundException: The given key 'time' was not present in the dictionary.
This commit is contained in:
parent
4de654b6e4
commit
497b5b44d6
1 changed files with 2 additions and 2 deletions
|
@ -101,8 +101,8 @@ public class Client : IDisposable {
|
|||
}
|
||||
|
||||
public TagPacket? GetTagPacket() {
|
||||
var time = (Time?) this.Metadata?["time"];
|
||||
var seek = (bool?) this.Metadata?["seeking"];
|
||||
var time = (Time?) (this.Metadata.ContainsKey("time") ? this.Metadata["time"] : null);
|
||||
var seek = (bool?) (this.Metadata.ContainsKey("seeking") ? this.Metadata["seeking"] : null);
|
||||
if (time == null && seek == null) { return null; }
|
||||
return new TagPacket {
|
||||
UpdateType = (seek != null ? TagPacket.TagUpdate.State : 0) | (time != null ? TagPacket.TagUpdate.Time: 0),
|
||||
|
|
Loading…
Reference in a new issue