summaryrefslogtreecommitdiff
path: root/transformsession.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'transformsession.cpp')
-rw-r--r--transformsession.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/transformsession.cpp b/transformsession.cpp
index 9cf5cf3b..14aabcea 100644
--- a/transformsession.cpp
+++ b/transformsession.cpp
@@ -41,19 +41,28 @@ TransformSession::~TransformSession()
Ref<BinaryView> TransformSession::GetCurrentView() const
{
- return new BinaryView(BNTransformSessionGetCurrentView(m_object));
+ BNBinaryView* view = BNTransformSessionGetCurrentView(m_object);
+ if (!view)
+ return nullptr;
+ return new BinaryView(view);
}
Ref<TransformContext> TransformSession::GetRootContext() const
{
- return new TransformContext(BNTransformSessionGetRootContext(m_object));
+ BNTransformContext* context = BNTransformSessionGetRootContext(m_object);
+ if (!context)
+ return nullptr;
+ return new TransformContext(context);
}
Ref<TransformContext> TransformSession::GetCurrentContext() const
{
- return new TransformContext(BNTransformSessionGetCurrentContext(m_object));
+ BNTransformContext* context = BNTransformSessionGetCurrentContext(m_object);
+ if (!context)
+ return nullptr;
+ return new TransformContext(context);
}