java - Logcat Null Check Returning False Positive -
i'm doing simple test (attempting null check value) , kicks decided null check make believe / nonexistant value: "striiing" not exist anywhere in source code. checked logcat , realized non existent value appears as:
04-18 04:40:22.197: d/com.game.demo.level1(15800): broken value! debug! debug!
when executing following:
if ("striiing" != null) { log.d(tag, "broken value! debug! debug!"); prefs.getboolean("name", true); prefs.getboolean("player", true); prefs.getboolean("points", true); prefs.getboolean("level", true); prefs.getboolean("gear", true);
can explain why non existent value could/would show being not null? it's quite bizarre.
"striiing"
string literal, non null object in java. try instead:
string s = null; if (s == null) ...
and should work expected.
Comments
Post a Comment