@@ -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 .debug ("No key fields found for the table, cannot set details URL: " + ti .getPublicSchemaName () + "." + ti .getPublicName ());
132+ return ;
133+ }
128134
129135 if (_settings .getPrimaryKeyField () != null )
130136 {
@@ -169,13 +175,25 @@ 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+ // There does not seem to be a more direct test for 'is editable'
189+ if (ti .getUpdateService () == null )
190+ {
191+ return ;
192+ }
193+
194+ _log .debug ("No key fields found for the table, cannot customize edit UI: " + ti .getPublicSchemaName () + "." + ti .getPublicName ());
195+ return ;
196+ }
179197
180198 if (_settings .getPrimaryKeyField () != null )
181199 {
0 commit comments