Unity Issue Tracker - "PlayerPrefs.GetString" returns an empty string when the default value is set to "null"
Closed
UUM-48261
"PlayerPrefs.GetString" returns an empty string when the default value is set to "null"
Unity: Scripting Runtime
Won't Fix
2023.3.X
2023.2.X
2023.1.X
2022.3.X
2021.3.X
This is by design. You can never get null from PlayerPrefs.GetString() API.
Reproduction steps:
1. Open project “PlayerPrefsRepro.zip”
2. Open “SampleScene”
3. Enter Play Mode
4. Observe the Console
Expected result: No error is thrown
Actual result: “AssertionException: Assertion failure. Values are not equal. Expected: == “ error is thrown in the console