Check if checkbox is null before accessing properties

Fix for #2