File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 2121using System . Collections . Generic ;
2222using System . Globalization ;
2323
24+ #nullable enable
25+
2426namespace OpenQA . Selenium
2527{
2628 /// <summary>
@@ -352,13 +354,14 @@ public static class Keys
352354 /// </summary>
353355 public static readonly string ZenkakuHankaku = Convert . ToString ( Convert . ToChar ( 0xE040 , CultureInfo . InvariantCulture ) , CultureInfo . InvariantCulture ) ;
354356
355- private static Dictionary < string , string > descriptions ;
357+ private static Dictionary < string , string > ? descriptions ;
356358
357359 /// <summary>
358360 /// Gets the description of a specific key.
359361 /// </summary>
360362 /// <param name="value">The key value for which to get the description.</param>
361363 /// <returns>The description of the key.</returns>
364+ /// <exception cref="ArgumentNullException">If <paramref name="value"/> is <see langword="null"/>.</exception>
362365 internal static object GetDescription ( string value )
363366 {
364367 if ( descriptions == null )
@@ -423,9 +426,9 @@ internal static object GetDescription(string value)
423426 descriptions . Add ( ZenkakuHankaku , "Zenkaku Hankaku" ) ;
424427 }
425428
426- if ( descriptions . ContainsKey ( value ) )
429+ if ( descriptions . TryGetValue ( value , out string ? description ) )
427430 {
428- return descriptions [ value ] ;
431+ return description ;
429432 }
430433
431434 return value ;
You can’t perform that action at this time.
0 commit comments