File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -691,17 +691,20 @@ void normalize_libpostal(sqlite3pp::database& db, std::string address_expansion_
691691 // insert normalized, but not expanded string
692692 {
693693 char *normalized = libpostal_normalize_string (charbuff.data (), LIBPOSTAL_NORMALIZE_DEFAULT_STRING_OPTIONS);
694- sqlite3pp::command cmd (db, " INSERT INTO normalized_name (prim_id, name) VALUES (?,?)" );
695- std::string s = normalized;
696- cmd.binder () << d.id
697- << s;
698- if (cmd.execute () != SQLITE_OK)
694+ if (normalized != NULL )
699695 {
700- // std::cerr << "Error inserting: " << d.id << " " << s << std::endl;
701- num_doubles_dropped++;
696+ sqlite3pp::command cmd (db, " INSERT INTO normalized_name (prim_id, name) VALUES (?,?)" );
697+ std::string s = normalized;
698+ cmd.binder () << d.id
699+ << s;
700+ if (cmd.execute () != SQLITE_OK)
701+ {
702+ // std::cerr << "Error inserting: " << d.id << " " << s << std::endl;
703+ num_doubles_dropped++;
704+ }
705+
706+ free (normalized);
702707 }
703-
704- free (normalized);
705708 }
706709
707710 char **expansions = libpostal_expand_address (charbuff.data (), options, &num_expansions);
You can’t perform that action at this time.
0 commit comments