38
38
import stroom .query .client .presenter .QueryEditPresenter .QueryEditView ;
39
39
import stroom .query .client .view .QueryResultTabsView ;
40
40
import stroom .util .shared .DefaultLocation ;
41
+ import stroom .util .shared .GwtNullSafe ;
41
42
import stroom .util .shared .Indicators ;
42
43
import stroom .util .shared .Severity ;
43
44
import stroom .util .shared .StoredError ;
60
61
61
62
import java .util .Collections ;
62
63
import java .util .List ;
64
+ import java .util .Objects ;
63
65
import java .util .Set ;
64
66
import java .util .function .Function ;
65
67
import javax .inject .Provider ;
@@ -154,7 +156,7 @@ public void setData(final Result componentResult) {
154
156
}
155
157
156
158
final QLVisResult visResult = (QLVisResult ) componentResult ;
157
- if (visResult . getJsonData () != null && visResult .getJsonData (). length () > 0 ) {
159
+ if (! GwtNullSafe . isBlankString ( visResult .getJsonData ()) ) {
158
160
hasData = true ;
159
161
setVisHidden (false );
160
162
}
@@ -339,7 +341,10 @@ private void stop() {
339
341
340
342
private void run (final boolean incremental ,
341
343
final boolean storeHistory ) {
342
- queryInfo .prompt (() -> run (incremental , storeHistory , Function .identity ()));
344
+ // No point running the search if there is no query
345
+ if (!GwtNullSafe .isBlankString (editorPresenter .getText ())) {
346
+ queryInfo .prompt (() -> run (incremental , storeHistory , Function .identity ()));
347
+ }
343
348
}
344
349
345
350
private void run (final boolean incremental ,
@@ -361,7 +366,6 @@ private void run(final boolean incremental,
361
366
incremental ,
362
367
storeHistory ,
363
368
queryInfo .getMessage ());
364
- // }
365
369
}
366
370
367
371
public TimeRange getTimeRange () {
@@ -378,7 +382,8 @@ public void setQuery(final DocRef docRef, final String query, final boolean read
378
382
queryModel .init (docRef .getUuid ());
379
383
if (query != null ) {
380
384
reading = true ;
381
- if (editorPresenter .getText ().length () == 0 || !editorPresenter .getText ().equals (query )) {
385
+ if (GwtNullSafe .isBlankString (editorPresenter .getText ())
386
+ || !Objects .equals (editorPresenter .getText (), query )) {
382
387
editorPresenter .setText (query );
383
388
queryHelpPresenter .setQuery (query );
384
389
}
0 commit comments