The material slot index check in `add_single_point_and_curve` in `grease_pencil_pen.cc` would check if the selected material slot index was not 0. I think the idea was to check if there isn't any active material slot selected, in which case `const int material_index = this->vc.obact->actcol - 1;` would return -1. This PR just changes the check value from 0 to -1. Pull Request: https://projects.blender.org/blender/blender/pulls/145473