Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Qt6: explicitly check the scoped pointer for null

Halla Remptf81b0e733359
diff --git a/libs/image/commands/kis_node_opacity_command.cpp b/libs/image/commands/kis_node_opacity_command.cpp
index c382cea28d..49784c3770 100644
--- a/libs/image/commands/kis_node_opacity_command.cpp
+++ b/libs/image/commands/kis_node_opacity_command.cpp
@@ -91,8 +91,8 @@ bool KisNodeOpacityCommand::canMergeWith(const KUndo2Command *command) const
if (!other) return false;
- bool otherCreatedKeyframe = other->m_autokey;
- bool weCreatedKeyframe = m_autokey;
+ bool otherCreatedKeyframe = !other->m_autokey.isNull();
+ bool weCreatedKeyframe = !m_autokey.isNull();
bool canMergeKeyframe = ((otherCreatedKeyframe ^ weCreatedKeyframe) == true) || (!otherCreatedKeyframe && !weCreatedKeyframe);
return other->m_node == m_node && canMergeKeyframe;