-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
49 additions
and
77 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/BD.SteamClient8.Impl/Extensions/SteamSessionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace BD.SteamClient8.Impl.Extensions; | ||
|
||
/// <summary> | ||
/// <see cref="SteamSession"/> 扩展方法 | ||
/// </summary> | ||
public static class SteamSessionExtensions | ||
{ | ||
/// <summary> | ||
/// 空引用抛出异常,提示用户登录 | ||
/// </summary> | ||
/// <param name="steamSession"></param> | ||
/// <param name="steam_id"></param> | ||
/// <returns></returns> | ||
/// <exception cref="NullReferenceException"></exception> | ||
public static SteamSession ThrowIsNull(this SteamSession? steamSession, string steam_id) | ||
{ | ||
if (steamSession is null) | ||
throw new NullReferenceException($"Unable to find session for {steam_id}, please login first"); | ||
return steamSession; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters