Permalink
Browse files

Do not try to parse HLint output if empty

  • Loading branch information...
1 parent 26a53ca commit 5bc5813c2c06c18272bdc77f7e28a9f8e9301b31 @JPMoresmau committed Aug 12, 2013
@@ -12,6 +12,7 @@ Necessary Haskell packages:
Fixes:
- Spaces in Hugs executable path accepted in preference page
- Show UUAGC errors correctly (https://github.com/JPMoresmau/eclipsefp/issues/125)
+ - Do not try to parse HLint output if empty
Features:
@@ -151,7 +151,7 @@ available at http://www.eclipse.org/legal/epl-v10.html.
id="net.sf.eclipsefp.haskell.hlint"
download-size="0"
install-size="0"
- version="2.5.3.qualifier"
+ version="2.5.5.qualifier"
unpack="false"/>
<plugin
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: net.sf.eclipsefp.haskell.hlint;singleton:=true
-Bundle-Version: 2.5.3.qualifier
+Bundle-Version: 2.5.5.qualifier
Bundle-Activator: net.sf.eclipsefp.haskell.hlint.HLintPlugin
Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
@@ -42,8 +42,12 @@
int code=new ProcessRunner().executeBlocking(
workingDir.toFile(), out, err, exe,"--encoding="+encoding, file.getLocation().toOSString());
- OutputParser parser = new OutputParser(new StringReader(out.toString()));
- List<Suggestion> sugs= parser.suggestions();
+ String s=out.toString();
+ List<Suggestion> sugs=new ArrayList<Suggestion>();
+ if (s.length()>0){
+ OutputParser parser = new OutputParser(new StringReader(s));
+ sugs= parser.suggestions();
+ }
if(err.toString().length()>0){
HLintPlugin.logError(NLS.bind(HLintText.error_run,err.toString()),null);
} else if (code!=0 && sugs.size()==0){

0 comments on commit 5bc5813

Please sign in to comment.