Fix android crash when model detects nothing

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17119

Reviewed By: sf-wind

Differential Revision: D14087835

Pulled By: ZhizhenQin

fbshipit-source-id: 32e61d46679bae645fd0bbec724513cfa5c553ab
This commit is contained in:
Zhizhen Qin
2019-02-14 17:22:34 -08:00
committed by Facebook Github Bot
parent d61455cf40
commit 6a46738986

View File

@ -82,7 +82,9 @@ void writeTextOutput(
}
// remove the last ,
string str = line.str();
str.pop_back();
if(str.length() != 0) {
str.pop_back();
}
lines.push_back(str);
// static casts are workaround for MSVC build