From b0825d5d6ff8e3e2c99d28f2c361444789356d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Thu, 16 Nov 2017 08:58:44 +0100 Subject: [PATCH] Fix nullptr dereference --- include/cppast/cpp_variable_base.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cppast/cpp_variable_base.hpp b/include/cppast/cpp_variable_base.hpp index fcd3a7d..75c0d8d 100644 --- a/include/cppast/cpp_variable_base.hpp +++ b/include/cppast/cpp_variable_base.hpp @@ -26,7 +26,7 @@ namespace cppast /// \returns A [ts::optional_ref]() to the [cppast::cpp_expression]() that is the default value. type_safe::optional_ref default_value() const noexcept { - return type_safe::ref(*default_); + return type_safe::opt_ref(default_.get()); } protected: