Handle info_buf possible nullptr

This commit is contained in:
Charles J. Cliffe 2016-02-05 18:43:54 -05:00
parent 305cd4bf5b
commit f9ee9b9145
1 changed files with 6 additions and 1 deletions

View File

@ -52,7 +52,12 @@ void RigThread::run() {
}
char *info_buf = (char *)rig_get_info(rig);
std::cout << "Rig info: " << info_buf << std::endl;
if (info_buf) {
std::cout << "Rig info: " << info_buf << std::endl;
} else {
std::cout << "Rig info was NULL." << std::endl;
}
while (!terminated.load()) {
std::this_thread::sleep_for(std::chrono::milliseconds(150));