소스 검색

fixed issue #296 , NPE

agapple 8 년 전
부모
커밋
f6c2eb8963
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java

+ 4 - 4
client/src/main/java/com/alibaba/otter/canal/client/impl/ClusterCanalConnector.java

@@ -108,7 +108,7 @@ public class ClusterCanalConnector implements CanalConnector {
                 return;
             } catch (Throwable t) {
                 logger.warn("something goes wrong when subscribing from server:{}\n{}",
-                    currentConnector.getAddress(),
+                    currentConnector != null ? currentConnector.getAddress() : "null",
                     ExceptionUtils.getFullStackTrace(t));
                 times++;
                 restart();
@@ -127,7 +127,7 @@ public class ClusterCanalConnector implements CanalConnector {
                 return;
             } catch (Throwable t) {
                 logger.warn("something goes wrong when unsubscribing from server:{}\n{}",
-                    currentConnector.getAddress(),
+                    currentConnector != null ? currentConnector.getAddress() : "null",
                     ExceptionUtils.getFullStackTrace(t));
                 times++;
                 restart();
@@ -145,7 +145,7 @@ public class ClusterCanalConnector implements CanalConnector {
                 return msg;
             } catch (Throwable t) {
                 logger.warn("something goes wrong when getting data from server:{}\n{}",
-                    currentConnector.getAddress(),
+                    currentConnector != null ? currentConnector.getAddress() : "null",
                     ExceptionUtils.getFullStackTrace(t));
                 times++;
                 restart();
@@ -163,7 +163,7 @@ public class ClusterCanalConnector implements CanalConnector {
                 return msg;
             } catch (Throwable t) {
                 logger.warn("something goes wrong when getting data from server:{}\n{}",
-                    currentConnector.getAddress(),
+                    currentConnector != null ? currentConnector.getAddress() : "null",
                     ExceptionUtils.getFullStackTrace(t));
                 times++;
                 restart();