for(var/CO in chemicals)
if(CO:cname == C.cname)
matches += CO
match = CO
Problem description:
So yeah, there is a runtime error reading CO:cname that says: runtime error: Cannot read /datum/chemical/testrazine (/datum/chemical/testrazine).cname
I narrowed it down to the CO by splitting the code to two lines. I had this error before while working with datums, but resolved it myself, and don't really know what causes it. I even tried some other examples to fix it and nothing works.