Skip to content

Commit

Permalink
Debug Search Controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Hossara committed Jun 15, 2022
1 parent 5846f0d commit d4a5113
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ class SearchController(

// Convert Result To Json
val jsonSearchResult = Gson()
.toJson(mutableListOf(indexItems.size, indexItems[page - 1]))
.toJson({
if(indexItems.isNotEmpty()) mutableListOf(indexItems.size, indexItems[page - 1])
else mutableListOf()
})

// Send Result To Client
searchDispatcher.send(stompHeaderAccessor.sessionId!!, jsonSearchResult)
Expand Down

0 comments on commit d4a5113

Please sign in to comment.