     //MARK: - Layout
     override open func layoutSubviews() {
         super.layoutSubviews()
-        let size = self.scrollView!.bounds.size
-        self.frame = CGRect(x: 0, y: self.contentSize.height, width: size.width, height: self.height)
-        self.activityIndicatorView.center = self.bounds.center
+        if let size = self.scrollView?.bounds.size {
+            self.frame = CGRect(x: 0, y: self.contentSize.height, width: size.width, height: self.height)
+            self.activityIndicatorView.center = self.bounds.center
+        }
         self.bringSubview(toFront: self.activityIndicatorView)
     }
     

        fatalError("init(coder:) has not been implemented")
    }
    
    //MARK: - Setup
    func setup() {
        self.activityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .gray)

    // ScrollView
    
    func resetInsets() {
        if var contentInset = self.scrollView?.contentInset {
            contentInset.bottom = self.originalInset.bottom
            self.setContentInset(contentInset)
        }
    }
    
    func adjustInsets() {
        if var contentInset = self.scrollView?.contentInset {
            if self.isEnabled {
                contentInset.bottom = self.originalInset.bottom + self.height
            }
            self.setContentInset(contentInset)
        }
    }
    
    func setContentInset(_ contentInset: UIEdgeInsets) {
