Refactor: libpacemaker: add safety check for NULL
Not really possible in practice, but makes static analysis happy