summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHunternif <hunternif@gmail.com>2019-04-09 02:27:51 +0700
committerHunternif <hunternif@gmail.com>2019-04-09 02:27:51 +0700
commit9e9924932dca2e4316dd56cb3f4de0f9580b131e (patch)
tree8eaf15766cc07f959dc181ca27b13dc890faa5b7
parentc35e89b83cdbfbbf0a88ddfd7b4a177f1ae419ba (diff)
Null check
-rw-r--r--client/js/models/post_list.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/client/js/models/post_list.js b/client/js/models/post_list.js
index 57a7d84..80bd41e 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(