Skip to content

Commit

Permalink
fix(SQLite): exception with some fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Dec 16, 2021
1 parent 648a51e commit e7a1858
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/libs/clients/SQLiteClient.js
@@ -1,7 +1,7 @@
'use strict';
import sqlite from 'better-sqlite3';
import { AntaresCore } from '../AntaresCore';
import dataTypes from 'common/data-types/mysql';
import dataTypes from 'common/data-types/sqlite';
import { NUMBER, FLOAT, TIME, DATETIME } from 'common/fieldTypes';

export class SQLiteClient extends AntaresCore {
Expand Down Expand Up @@ -732,7 +732,7 @@ export class SQLiteClient extends AntaresCore {

if ([...TIME, ...DATETIME].includes(parsedType)) {
const firstNotNull = queryResult.find(res => res[field.name] !== null);
if (firstNotNull[field.name].includes('.'))
if (firstNotNull && firstNotNull[field.name].includes('.'))
length = firstNotNull[field.name].split('.').pop().length;
}

Expand Down

0 comments on commit e7a1858

Please sign in to comment.