@@ -138,23 +138,29 @@ namespace sqlite {
138
138
}
139
139
void get_col_from_db (int inx, string& s){
140
140
if (sqlite3_column_type (_stmt, inx) == SQLITE_NULL) s = string ();
141
- sqlite3_column_bytes (_stmt, inx);
142
- s = string ((char *)sqlite3_column_text (_stmt, inx));
141
+ else {
142
+ sqlite3_column_bytes (_stmt, inx);
143
+ s = string ((char *)sqlite3_column_text (_stmt, inx));
144
+ }
143
145
}
144
146
void get_col_from_db (int inx, wstring& w){
145
147
if (sqlite3_column_type (_stmt, inx) == SQLITE_NULL) w = wstring ();
146
- sqlite3_column_bytes16 (_stmt, inx);
147
- w = wstring ((wchar_t *)sqlite3_column_text16 (_stmt, inx));
148
+ else {
149
+ sqlite3_column_bytes16 (_stmt, inx);
150
+ w = wstring ((wchar_t *)sqlite3_column_text16 (_stmt, inx));
151
+ }
148
152
}
149
153
void get_col_from_db (int inx, double & d){
150
154
if (sqlite3_column_type (_stmt, inx) == SQLITE_NULL)
151
155
d = 0 ;
152
- d = sqlite3_column_double (_stmt, inx);
156
+ else
157
+ d = sqlite3_column_double (_stmt, inx);
153
158
}
154
159
void get_col_from_db (int inx, float & f){
155
160
if (sqlite3_column_type (_stmt, inx) == SQLITE_NULL)
156
161
f = 0 ;
157
- f = float (sqlite3_column_double (_stmt, inx));
162
+ else
163
+ f = float (sqlite3_column_double (_stmt, inx));
158
164
}
159
165
#pragma endregion
160
166
0 commit comments