     
     /// if possible, it will undo the last stroke
     public func undo() -> Void {
-        if undoManager != nil && undoManager!.canUndo {
+        if undoManager!.canUndo {
             undoManager?.undo()
             
             if !redoEnabled {

    
    /// if possible, it will redo the last undone stroke
    public func redo() -> Void {
        if undoManager != nil && undoManager!.canRedo {
            undoManager?.redo()
            
            if !undoEnabled {

        
        checkClearState()
        
        if !undoManager!.canRedo {
            if redoEnabled {
                delegate.redoDisabled()
                redoEnabled = false
