aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/Resource.hh10
-rw-r--r--src/Slit.cc6
2 files changed, 11 insertions, 5 deletions
diff --git a/src/FbTk/Resource.hh b/src/FbTk/Resource.hh
index b729ad4..e3e8cc1 100644
--- a/src/FbTk/Resource.hh
+++ b/src/FbTk/Resource.hh
@@ -257,9 +257,13 @@ public:
257 257
258 virtual void setFromLua(lua::state &l) { 258 virtual void setFromLua(lua::state &l) {
259 try { 259 try {
260 m_value = Traits::fromLua(l); 260 if(l.isnil(-1))
261 m_rm->resourceChanged(*this); 261 setDefaultValue();
262 m_modified_sig.emit(m_value); 262 else {
263 m_value = Traits::fromLua(l);
264 m_rm->resourceChanged(*this);
265 m_modified_sig.emit(m_value);
266 }
263 } 267 }
264 catch(ConversionError &e) { 268 catch(ConversionError &e) {
265 std::cerr << name() << ": " << e.what() << std::endl; 269 std::cerr << name() << ": " << e.what() << std::endl;
diff --git a/src/Slit.cc b/src/Slit.cc
index d9681a1..deb8e3b 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -153,8 +153,10 @@ void Slit::SlitClientsRes::setFromLua(lua::state &l) {
153 SlitClients t; 153 SlitClients t;
154 154
155 if(l.type(-1) != lua::TTABLE) { 155 if(l.type(-1) != lua::TTABLE) {
156 std::cerr << "Cannot convert to a client list from lua type " 156 if(! l.isnil(-1)) {
157 << l.type_name(l.type(-1)) << std::endl; 157 std::cerr << "Cannot convert to a client list from lua type "
158 << l.type_name(l.type(-1)) << std::endl;
159 }
158 return; 160 return;
159 } 161 }
160 for(size_t i = 1; l.rawgeti(-1, i), !l.isnil(-1); l.pop(), ++i) { 162 for(size_t i = 1; l.rawgeti(-1, i), !l.isnil(-1); l.pop(), ++i) {