Fix a JavaScript error in case of null attribute and an interface conversion error in the API server (#540)

This commit is contained in:
M. Mert Yıldıran
2021-12-17 17:26:36 +03:00
committed by GitHub
parent 3b69508581
commit 23332639d0
2 changed files with 8 additions and 2 deletions

View File

@@ -579,12 +579,18 @@ func representConnectionStart(event map[string]interface{}) []interface{} {
}
func representConnectionClose(event map[string]interface{}) []interface{} {
replyCode := ""
if event["replyCode"] != nil {
replyCode = fmt.Sprintf("%g", event["replyCode"].(float64))
}
rep := make([]interface{}, 0)
details, _ := json.Marshal([]api.TableData{
{
Name: "Reply Code",
Value: fmt.Sprintf("%g", event["replyCode"].(float64)),
Value: replyCode,
Selector: `request.replyCode`,
},
{

View File

@@ -66,7 +66,7 @@ export const EntriesList: React.FC<EntriesListProps> = ({entries, setEntries, qu
}
setIsLoadingTop(true);
const data = await api.fetchEntries(leftOffTop, -1, query, 100, 3000);
if (!data || !data.meta) {
if (!data || data.data === null || data.meta === null) {
setNoMoreDataTop(true);
setIsLoadingTop(false);
return;