[library] Fix handling of null AdapterDataSetObserver

Fixes #7