Skip to content

Commit 7098baf

Browse files
committed
Clean up trigger/customizer layer code
1 parent 507df9a commit 7098baf

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

LDK/src/org/labkey/ldk/query/DefaultTableCustomizer.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,19 @@ private void setDetailsUrl(AbstractTableInfo ti)
118118
}
119119

120120
String schemaName = ti.getUserSchema().getSchemaName();
121-
assert schemaName != null;
122-
123121
String queryName = ti.getPublicName();
124-
assert queryName != null;
122+
if (queryName == null)
123+
{
124+
_log.error("TableInfo.getPublicName() was null", new Exception());
125+
return;
126+
}
125127

126128
List<String> keyFields = ti.getPkColumnNames();
127-
assert !keyFields.isEmpty() : "No key fields found for the table: " + ti.getPublicSchemaName() + "." + ti.getPublicName();
129+
if (keyFields.isEmpty())
130+
{
131+
_log.error("No key fields found for the table: " + ti.getPublicSchemaName() + "." + ti.getPublicName());
132+
return;
133+
}
128134

129135
if (_settings.getPrimaryKeyField() != null)
130136
{
@@ -169,13 +175,19 @@ else if (_settings.isSetEditLinkOverrides())
169175
{
170176
//otherwise apply custom urls
171177
String schemaName = ti.getUserSchema().getSchemaName();
172-
assert schemaName != null;
173-
174178
String queryName = ti.getPublicName();
175-
assert queryName != null;
179+
if (queryName == null)
180+
{
181+
_log.error("TableInfo.getPublicName() was null", new Exception());
182+
return;
183+
}
176184

177185
List<String> keyFields = ti.getPkColumnNames();
178-
assert !keyFields.isEmpty() : "No key fields found for the table: " + ti.getPublicSchemaName() + "." + ti.getPublicName();
186+
if (keyFields.isEmpty())
187+
{
188+
_log.error("No key fields found for the table: " + ti.getPublicSchemaName() + "." + ti.getPublicName());
189+
return;
190+
}
179191

180192
if (_settings.getPrimaryKeyField() != null)
181193
{

0 commit comments

Comments
 (0)