 
         let waveformRenderOperation = FDWaveformRenderOperation(audioContext: audioContext) { image in
             DispatchQueue.main.async {
+                self.renderForCurrentAssetFailed = (image == nil)
                 print("done")
                 self.waveformImage = image
-                self.cachedSampleRange = renderSampleRange
+                self.cachedSampleRange = (image != nil) ? renderSampleRange : nil
                 self.renderingInProgress = false
                 self.setNeedsLayout()
                 self.delegate?.waveformViewDidRender?(self)


    // Mark - Private vars

    /// Current audio context to be used for rendering
    private var audioContext: FDAudioContext? {
        didSet {

        var scaledX: CGFloat = 0.0
        var scaledProgressWidth: CGFloat = 0.0
        var scaledWidth: CGFloat = 1.0
        if let cachedSampleRange = cachedSampleRange, !cachedSampleRange.isEmpty && !zoomSamples.isEmpty {
            scaledX = CGFloat(cachedSampleRange.lowerBound - zoomSamples.lowerBound) / CGFloat(zoomSamples.count)
            scaledWidth = CGFloat(cachedSampleRange.last! - zoomSamples.lowerBound) / CGFloat(zoomSamples.count)    // forced unwrap is safe
            scaledProgressWidth = CGFloat(progressSamples - zoomSamples.lowerBound) / CGFloat(zoomSamples.count)
