[BUGFIX] Compare the value instead of setting a variable

Change-Id: I8be8c65fef7cec6265d4c245dee9b7c896860c33
Resolves: #53469