is.finite(frame) rather than !is.null (#290 again)

I haven't tested but I believe something like this could work.