Fix NPE in HgErrorHandler

This commit is contained in:
Kirill Likhodedov
2011-08-19 18:25:40 +04:00
parent a9459e363f
commit d3f1823f8a
@@ -13,11 +13,15 @@
package org.zmlx.hg4idea;
import com.intellij.openapi.vcs.VcsException;
import org.jetbrains.annotations.Nullable;
import org.zmlx.hg4idea.execution.HgCommandResult;
public abstract class HgErrorHandler {
public static HgCommandResult ensureSuccess(HgCommandResult result) throws VcsException {
public static HgCommandResult ensureSuccess(@Nullable HgCommandResult result) throws VcsException {
if (result == null) {
throw new VcsException("Couldn't execute Mercurial command");
}
if (fatalErrorOccurred(result)) {
throw new VcsException(result.getRawError());
}