未验证 提交 18ed80bd 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Fix missing language field. (#2174)

上级 9cda28f0
...@@ -197,6 +197,8 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO { ...@@ -197,6 +197,8 @@ public class MetadataQueryEsDAO extends EsDAO implements IMetadataQueryDAO {
JsonObject properties = GSON.fromJson(propertiesString, JsonObject.class); JsonObject properties = GSON.fromJson(propertiesString, JsonObject.class);
if (properties.has(LANGUAGE)) { if (properties.has(LANGUAGE)) {
serviceInstance.setLanguage(LanguageTrans.INSTANCE.value(properties.get(LANGUAGE).getAsString())); serviceInstance.setLanguage(LanguageTrans.INSTANCE.value(properties.get(LANGUAGE).getAsString()));
} else {
serviceInstance.setLanguage(Language.UNKNOWN);
} }
if (properties.has(OS_NAME)) { if (properties.has(OS_NAME)) {
......
...@@ -222,6 +222,8 @@ public class H2MetadataQueryDAO implements IMetadataQueryDAO { ...@@ -222,6 +222,8 @@ public class H2MetadataQueryDAO implements IMetadataQueryDAO {
JsonObject properties = GSON.fromJson(propertiesString, JsonObject.class); JsonObject properties = GSON.fromJson(propertiesString, JsonObject.class);
if (properties.has(LANGUAGE)) { if (properties.has(LANGUAGE)) {
serviceInstance.setLanguage(LanguageTrans.INSTANCE.value(properties.get(LANGUAGE).getAsString())); serviceInstance.setLanguage(LanguageTrans.INSTANCE.value(properties.get(LANGUAGE).getAsString()));
} else {
serviceInstance.setLanguage(Language.UNKNOWN);
} }
if (properties.has(OS_NAME)) { if (properties.has(OS_NAME)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册