Add error message for ApplyFunction

This commit is contained in:
Grant Sanderson 2019-12-15 08:44:57 -08:00
parent 5cce05fc46
commit c74cfa3c5d

View file

@ -230,7 +230,10 @@ class ApplyFunction(Transform):
super().__init__(mobject, **kwargs)
def create_target(self):
return self.function(self.mobject.copy())
target = self.function(self.mobject.copy())
if not isinstance(target, Mobject):
raise Exception("Functions passed to ApplyFunction must return object of type Mobject")
return target
class ApplyMatrix(ApplyPointwiseFunction):