Bugfix: Avoid npe if cursor is null.