Fix the bug that the app will crash when sharedpreference exists