diff --git a/handlers.c b/handlers.c index 002c311..d9d7c35 100644 --- a/handlers.c +++ b/handlers.c @@ -51,6 +51,11 @@ allocField(char **field, char *str) void copyField(itemStruct *item, enum fields field, char *str) { + if (!str) { + logMsg(1, "Attempted to assign a null pointer to a field!\n"); + return; + } + allocField(&item->fields[field], str); }