diff --git a/.gitignore b/.gitignore index 57d60653..ce195c89 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ main.dSYM/ docs/references.md .xmake +.vs diff --git a/include/pocketpy/objects/sourcedata.hpp b/include/pocketpy/objects/sourcedata.hpp index 96b716f9..141ef54f 100644 --- a/include/pocketpy/objects/sourcedata.hpp +++ b/include/pocketpy/objects/sourcedata.hpp @@ -70,7 +70,7 @@ struct SourceData { } Str snapshot(int lineno, const char* cursor, std::string_view name) const { - return pkpy_SourceData__snapshot(self, lineno, cursor, name.data()); + return pkpy_SourceData__snapshot(self, lineno, cursor, name.empty() ? nullptr : name.data()); } ~SourceData() {