Merge "Fix potential crash when calling update but query db failed"