fix crash issue if user change landscape in my favorite fragment.
[root cause]
db is null.
[solution]
add condition to prevent crash.