             return
         }
         let iterator = levelDBIteratorNew(db)
-        if iterator == nil {
-            return
-        }
         var stop = false
+        #if swift(>=3.0)
+        guard let iteratorPointer = iterator else {
+            print("iterator is nil")
+            return
+        }
+        _startIterator(iteratorPointer, backward: backward, prefix: prefix, start: key)
+        #else
         _startIterator(iterator, backward: backward, prefix: prefix, start: key)
+        #endif
         while levelDBIteratorIsValid(iterator) {
             #if swift(>=3.0)
                 var iKey: UnsafeMutablePointer<Int8>? = nil

        }
        let iterator = levelDBIteratorNew(db)
        var stop = false
        _startIterator(iterator, backward: backward, prefix: prefix, start: key)
        while levelDBIteratorIsValid(iterator) {
            #if swift(>=3.0)
                var iKey: UnsafeMutablePointer<Int8>? = nil

            return
        }
        let iterator = levelDBIteratorNew(db)
        var stop = false
        #if swift(>=3.0)
        guard let iteratorPointer = iterator else {
            print("iterator is nil")
            return
        }
        _startIterator(iteratorPointer, backward: backward, prefix: prefix, start: key)
        #else
        _startIterator(iterator, backward: backward, prefix: prefix, start: key)
        #endif
        while levelDBIteratorIsValid(iterator) {
            #if swift(>=3.0)
                var iKey: UnsafeMutablePointer<Int8>? = nil
