Skip to content

Commit c9c1ba1

Browse files
Merge pull request #48 from karlseguin/null_subtype
allow null subtypes/descriptions
2 parents 3cb2368 + b680e6a commit c9c1ba1

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/binding.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,11 +1769,17 @@ v8::Local<v8::Context> v8_inspector__Client__IMPL::ensureDefaultContextInGroup(i
17691769
}
17701770
std::unique_ptr<v8_inspector::StringBuffer> v8_inspector__Client__IMPL::valueSubtype(v8::Local<v8::Value> value) {
17711771
auto subType = v8_inspector__Client__IMPL__valueSubtype(this, value);
1772+
if (subType == nullptr) {
1773+
return nullptr;
1774+
}
17721775
return v8_inspector::StringBuffer::create(toStringView(subType));
17731776
}
17741777
std::unique_ptr<v8_inspector::StringBuffer> v8_inspector__Client__IMPL::descriptionForValueSubtype(v8::Local<v8::Context> context, v8::Local<v8::Value> value) {
1775-
auto descriptions = v8_inspector__Client__IMPL__descriptionForValueSubtype(this, context, value);
1776-
return v8_inspector::StringBuffer::create(toStringView(descriptions));
1778+
auto description = v8_inspector__Client__IMPL__descriptionForValueSubtype(this, context, value);
1779+
if (description == nullptr) {
1780+
return nullptr;
1781+
}
1782+
return v8_inspector::StringBuffer::create(toStringView(description));
17771783
}
17781784

17791785
extern "C" {

src/binding.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,9 +988,9 @@ void v8_inspector__Client__IMPL__consoleAPIMessage(
988988
unsigned columnNumber, StackTrace *StackTrace);
989989
const Context* v8_inspector__Client__IMPL__ensureDefaultContextInGroup(
990990
InspectorClientImpl* self, void* data, int contextGroupId);
991-
const Context* v8_inspector__Client__IMPL__valueSubtype(
991+
char* v8_inspector__Client__IMPL__valueSubtype(
992992
InspectorClientImpl* self, Value value);
993-
const Context* v8_inspector__Client__IMPL__descriptionForValueSubtype(
993+
char* v8_inspector__Client__IMPL__descriptionForValueSubtype(
994994
InspectorClientImpl* self, Context context, Value value);
995995

996996

0 commit comments

Comments
 (0)