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_
691
691
// insert normalized, but not expanded string
692
692
{
693
693
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 )
699
695
{
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);
702
707
}
703
-
704
- free (normalized);
705
708
}
706
709
707
710
char **expansions = libpostal_expand_address (charbuff.data (), options, &num_expansions);
You can’t perform that action at this time.
0 commit comments