Skip to content

Commit 222a09a

Browse files
author
Alexis Lopez Zubieta
committed
Use explicit nullptr checks
1 parent d9dbb1f commit 222a09a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libappimage/utils/DLHandle.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace appimage {
2828
explicit DLHandle(const std::string& libName, int mode) : handle(nullptr), libName(libName) {
2929
handle = dlopen(libName.c_str(), mode);
3030

31-
if (!handle)
31+
if (handle == nullptr)
3232
throw DLHandleError("Unable to load " + libName);
3333
}
3434

@@ -41,13 +41,13 @@ namespace appimage {
4141
explicit DLHandle(std::initializer_list<const std::string> libNames, int mode) : handle(nullptr) {
4242
for (const auto& item: libNames) {
4343
handle = dlopen(item.c_str(), mode);
44-
if (handle) {
44+
if (handle != nullptr) {
4545
libName = item;
4646
break;
4747
}
4848
}
4949

50-
if (!handle) {
50+
if (handle == nullptr) {
5151
std::string libNamesStr;
5252
for (const auto& item: libNames)
5353
libNamesStr += " " + item;

0 commit comments

Comments
 (0)