# Preferences null check

**URL:** <https://forums.kodeco.com/t/preferences-null-check/189727>\
**Category:** Real-World Android by Tutorials\
**Created:** [July 23, 2023, 6:29pm UTC](https://forums.kodeco.com/t/preferences-null-check/189727 "2023-07-23T18:29:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![levent31](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@levent31](https://forums.kodeco.com/u/levent31)\
**Post date:** [July 23, 2023, 6:29pm UTC](https://forums.kodeco.com/t/preferences-null-check/189727/1 "2023-07-23T18:29:33Z")

</div>

According to the requirement, is it necessary to use `getString(KEY_TOKEN, "").orEmpty()` instead of `getString(KEY_TOKEN, "")` ? The `getString` function already defaults to an empty string (`""` ) and automatically returns an empty string if there is no value corresponding to the `KEY_TOKEN` key or if it is an empty string.
