ianva / vim-youdao-translater

vim的有道取词翻译插件
ianva.github.com
Other
132 stars 32 forks source link

翻译某些词会出错 #5

Closed hmgle closed 8 years ago

hmgle commented 8 years ago

有道词典返回的翻译内容 节点有可能为空值,例如翻译 splithttp://dict.youdao.com/fsearch?q=split

...
<translation>
    <content>vi. 离开;被劈开;断绝关系</content>
</translation>
<translation>
    <content></content>
</translation>
...

这时会抛出 AttributeError: 'NoneType' object has no attribute 'encode' 的错误。