From 7e32b1e11e2f448cb16bd8e8683db46347a3f739 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Tue, 30 Jul 2013 16:39:33 -0700 Subject: [PATCH] return if gvariant is null --- src/Vehicle/JSVehicle.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Vehicle/JSVehicle.cpp b/src/Vehicle/JSVehicle.cpp index 394e979..104c73c 100644 --- a/src/Vehicle/JSVehicle.cpp +++ b/src/Vehicle/JSVehicle.cpp @@ -226,6 +226,9 @@ JSValueRef JSVehicle::supported(JSContextRef context, GVariant * value = vehicle->listObjects(); + if(!value) + return JSValueMakeUndefined(context); + gsize size; std::string script; std::string valStr = json_gvariant_serialize_data(value,&size); -- 2.7.4