From 5d96e0e7870e07642c0e7fe34859baae071d4dc2 Mon Sep 17 00:00:00 2001 From: Hunternif Date: Tue, 9 Apr 2019 02:27:51 +0700 Subject: [PATCH] Null check --- client/js/models/post_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/js/models/post_list.js b/client/js/models/post_list.js index 57a7d841..80bd41ee 100644 --- a/client/js/models/post_list.js +++ b/client/js/models/post_list.js @@ -18,7 +18,7 @@ class PostList extends AbstractList { static search(text, offset, limit, fields) { //For queries with random sorting, bypass cache by appending random number - let cache = text.includes('sort:random') + let cache = text != null && text.includes('sort:random') ? Math.round(Math.random() * 1000) : 0; return api.get(