Commits

Bart van Strien committed ebd2a9b

Properly catch exceptions thrown by ImageData:getPixel/setPixel, thereby preventing an uncaught exception for an invalid index. (Bug #381)

Comments (0)

Files changed (1)

src/modules/image/wrap_ImageData.cpp

 		{
 			c = t->getPixel(x, y);
 		}
-		catch (love::Exception *e)
+		catch (love::Exception & e)
 		{
-			return luaL_error(L, "%s", e->what());
+			return luaL_error(L, "%s", e.what());
 		}
 		lua_pushnumber(L, c.r);
 		lua_pushnumber(L, c.g);
 		{
 			t->setPixel(x, y, c);
 		}
-		catch (love::Exception *e)
+		catch (love::Exception & e)
 		{
-			return luaL_error(L, "%s", e->what());
+			return luaL_error(L, "%s", e.what());
 		}
 		return 0;
 	}