diff --git a/bin/server.dart b/bin/server.dart index f85dcb0..cec58c8 100644 --- a/bin/server.dart +++ b/bin/server.dart @@ -76,6 +76,9 @@ Future _postRandomPost() async { if (!File('/data/posts.json').existsSync()) { return; } + if (!File('/data/horny.json').existsSync()) { + return; + } bool isHorny = false; @@ -116,6 +119,10 @@ void main(List args) async { await File('/data/posts.json').writeAsString(json.encode([])); } + if (!File('/data/horny.json').existsSync()) { + await File('/data/horny.json').writeAsString(json.encode([])); + } + // Import posts from files await _importPosts('/data/posts.txt', 'posts.json'); await _importPosts('/data/horny.txt', 'horny.json');