most times a build is declared failed, its about compilation issues, or health thresholds or simple scripting error status.
so most times, it has nothing to do with sloc.
the problem is that the failed build has no sloc summary data in the build.xml (it doesn't even coast from the previous non-failed build).
Can be addressed many options
0 - ignore failure state of build
1 - have an ignore failed build status option (many other publisher plugins have this
2 - if can't ignore fail status, at least coast the data from last non failed build
in general, suggest that unless there was a path issues (sloc count file doesn't exist) the results should always be published