[BUGFIX] Compare value instead of setting a variable

Change-Id: I37ca57fe8baa8da0677b91a3f1aab54201b43d69
Resolves: #53469