Git NPE
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Mon, 4 Apr 2011 09:00:02 +0000 (13:00 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Mon, 4 Apr 2011 09:14:41 +0000 (13:14 +0400)
plugins/git4idea/src/git4idea/commands/GitLineHandler.java

index cd619b6962fc689b497fc01751ea9cf4a1d4b57e..b341036552454dcb0b407ccbc2c3dfe9c9ca1ed6 100644 (file)
@@ -123,12 +123,16 @@ public class GitLineHandler extends GitTextHandler {
       }
     }
     while (true) {
-      String line = lines.next();
+      String line = null;
+      if (lines.hasNext()) {
+        line = lines.next();
+      }
+
       if (lines.hasNext()) {
         notifyLine(line, outputType);
       }
       else {
-        if (line.length() > 0) {
+        if (line != null && line.length() > 0) {
           lineBuilder.append(line);
         }
         break;