From f41d8c0480bc981d826b2408363fdde5b1719088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E6=9D=B0?= <1541683150@qq.com> Date: Tue, 14 Dec 2021 01:37:59 +0000 Subject: [PATCH] [TypeError: Cannot read properties of undefined (reading 'type') #152] bugfix --- src/main/libs/clients/MySQLClient.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/libs/clients/MySQLClient.js b/src/main/libs/clients/MySQLClient.js index 4a8cbf1f..2aff5e58 100644 --- a/src/main/libs/clients/MySQLClient.js +++ b/src/main/libs/clients/MySQLClient.js @@ -424,7 +424,7 @@ export class MySQLClient extends AntaresCore { return { name: field.COLUMN_NAME, key: field.COLUMN_KEY.toLowerCase(), - type: remappedFields ? remappedFields[field.COLUMN_NAME].type : field.DATA_TYPE, + type: (remappedFields && remappedFields[field.COLUMN_NAME]) ? remappedFields[field.COLUMN_NAME].type : field.DATA_TYPE, schema: field.TABLE_SCHEMA, table: field.TABLE_NAME, numPrecision: field.NUMERIC_PRECISION, @@ -436,7 +436,7 @@ export class MySQLClient extends AntaresCore { unsigned: field.COLUMN_TYPE.includes('unsigned'), zerofill: field.COLUMN_TYPE.includes('zerofill'), order: field.ORDINAL_POSITION, - default: remappedFields ? remappedFields[field.COLUMN_NAME].default : field.COLUMN_DEFAULT, + default: (remappedFields && remappedFields[field.COLUMN_NAME]) ? remappedFields[field.COLUMN_NAME].default : field.COLUMN_DEFAULT, charset: field.CHARACTER_SET_NAME, collation: field.COLLATION_NAME, autoIncrement: field.EXTRA.includes('auto_increment'),