Added a condition to ensure that "selectedProduct" is not null for populating the "prod" field for l2mapgen.