missing null check (fixes #24)