question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Null values are getting written when using a custom put resolver to prevent it

See original GitHub issue

I created a put resolver that looks like this:

public class UserPutResolver extends UserStorIOSQLitePutResolver {

  @NonNull
  @Override
  public ContentValues mapToContentValues(@NonNull User user) {
    ContentValues contentValues = super.mapToContentValues(user);
    if(TextUtils.isEmpty(user.getEmail())) {
      contentValues.remove(UsersTable.COLUMN_EMAIL);
    }
    return contentValues;
  }
}

Bascially if the user’s email is null, I don’t want to override it, so I remove the content value. When debugging, I know it hits this line and properly returns the ContentValues object without the email column.

I know I can use the ignorenull property, but i want to know why this is not working.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
nikitin-dacommented, Mar 2, 2017

Closed for now Feel free to reopen if you got this behavior on some sample code that you can publish 😉

0reactions
sreejithramancommented, Dec 13, 2016

hmm… interesting. yea, i’ll try to reproduce it and let you know if I am successful

Read more comments on GitHub >

github_iconTop Results From Across the Web

Skip null values with custom resolver - Stack Overflow
I have created a class which automatically goes through all the contracts are creates mappings. The only problem I have is that I...
Read more >
Using nullability in GraphQL
A field can either be nullable or non-null, and this tells you whether or not you could receive a null value when you...
Read more >
Solved: Update blank/Null value to fields (Date, User, Cho...
Solution : Enable the "Experimental features" as shown in below screenshot. This will resolve the issue and you will be able to update...
Read more >
Handling Null and Other Special Values - Tableau Help
To filter null dimensions or discrete measures, drag the pill to the Filter shelf and deselect Null. The null value will appear in...
Read more >
Why Hive Table is loading with NULL values?
You are getting NULL values loaded to the Hive table because your data is in comma-separated whereas Hive default separator is ^A hence...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found