aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libnvxx/nvxx.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/libnvxx/nvxx.cc b/libnvxx/nvxx.cc
index 43c983c..4ccd51f 100644
--- a/libnvxx/nvxx.cc
+++ b/libnvxx/nvxx.cc
@@ -48,6 +48,8 @@ __nv_list_base::__free_nv() noexcept
void
__nv_list_base::__throw_if_error() const
{
+ __throw_if_null();
+
if (auto err = ::nvlist_error(__m_nv); err != 0)
throw nv_error_state(std::error_code(err, std::generic_category()));
}