Skip to content

Commit c9df54f

Browse files
committed
null check
1 parent 0a440db commit c9df54f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

FlashpointSecurePlayer/RegistryStates.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,11 @@ private void SetValueInRegistryView(string keyName, string valueName, object val
341341

342342
// if it's an exact string match, don't worry about it
343343
if (valueKind == _valueKind) {
344-
if ((value as string).Equals(_value as string, StringComparison.Ordinal)) {
345-
return;
344+
if (value is string valueString
345+
&& _value is string _valueString) {
346+
if (valueString.Equals(_valueString, StringComparison.Ordinal)) {
347+
return;
348+
}
346349
}
347350
}
348351
} catch {

0 commit comments

Comments
 (0)