Damian ONeill
Committed by Gerrit Code Review

added some null checks for device instance

Change-Id: I84ab4365513a61bac4a5e852c8589fae3c828710
......@@ -164,7 +164,9 @@ public class NetconfDevice {
+ deviceInfo(), e);
} finally {
log.debug("Closing the session after successful execution");
ssh.close();
if (ssh != null) {
ssh.close();
}
}
}
......
......@@ -339,7 +339,7 @@ public class NetconfDeviceProvider extends AbstractProvider
+ device.deviceInfo(), e);
} catch (Exception e) {
log.error("Error while initializing session for the device: "
+ device.deviceInfo(), e);
+ (device != null ? device.deviceInfo() : null), e);
}
}
......
......@@ -378,7 +378,7 @@ public class NetconfDeviceProviderTest {
throw e;
} catch (Exception e) {
log.error("Error while initializing session for the device: "
+ device.deviceInfo(), e);
+ (device != null ? device.deviceInfo() : null), e);
}
}
......