[PATCH] Check curve_name for null to avoid crash