Merge "Fix potential NPE with null cursor" into klp-dev