Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use explicit nullptr checks
  • Loading branch information
Alexis Lopez Zubieta committed Apr 8, 2019
commit 222a09af47c63e22c404d2f8e0b0d17b0d67a559
6 changes: 3 additions & 3 deletions src/libappimage/utils/DLHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace appimage {
explicit DLHandle(const std::string& libName, int mode) : handle(nullptr), libName(libName) {
handle = dlopen(libName.c_str(), mode);

if (!handle)
if (handle == nullptr)
throw DLHandleError("Unable to load " + libName);
}

Expand All @@ -41,13 +41,13 @@ namespace appimage {
explicit DLHandle(std::initializer_list<const std::string> libNames, int mode) : handle(nullptr) {
for (const auto& item: libNames) {
handle = dlopen(item.c_str(), mode);
if (handle) {
if (handle != nullptr) {
libName = item;
break;
}
}

if (!handle) {
if (handle == nullptr) {
std::string libNamesStr;
for (const auto& item: libNames)
libNamesStr += " " + item;
Expand Down