Fix null pointer use
Fixes GTK3 compilation warning, fixes #365