From 9fec6bb942d5ae841b86a32df3324a88e4088a86 Mon Sep 17 00:00:00 2001 From: Andriy Rysin Date: Thu, 15 Aug 2019 13:46:29 -0400 Subject: [PATCH] skip loading media_src.txt if not found --- src/tools/groovy/editor/Editor.groovy | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/tools/groovy/editor/Editor.groovy b/src/tools/groovy/editor/Editor.groovy index f0e9d700..ec5abcbd 100755 --- a/src/tools/groovy/editor/Editor.groovy +++ b/src/tools/groovy/editor/Editor.groovy @@ -38,10 +38,16 @@ dict += new File('data/dict/names-other.lst').readLines() dict += new File('data/dict/geo-other.lst').readLines() dict += new File('data/dict/slang.lst').readLines() @Field -def media = new File('out/toadd/new_lemmas_find.txt').readLines().collectEntries { - def parts = it.split('@@@') - [ (parts[0]): parts.length > 1 ? parts[1..-1] : ["---"] ] +def media = [] + +def newLemmaFile = new File('out/toadd/new_lemmas_find.txt') +if( newLemmaFile.exists() ) { + media = newLemmaFile.readLines().collectEntries { + def parts = it.split('@@@') + [ (parts[0]): parts.length > 1 ? parts[1..-1] : ["---"] ] + } } + @Field def newWords = [] def newWordsFile = new File('new_words.lst')