driver/write_unique_name: hanlde NULL as input
In this case simply write out the empty string.
@@ -172,6 +172,11 @@ static void driver_dvar_write_unique_name(CDVar *var, Peer *peer) {
char unique_name[strlen(":1.") + C_DECIMAL_MAX(uint64_t) + 1];
int r;
+ if (!peer) {
+ c_dvar_write(var, "s", "");
+ return;
+ }
+
r = snprintf(unique_name, sizeof(unique_name), ":1.%"PRIu64, peer->id);
assert(r >= 0 && r < sizeof(unique_name));
