o.c.opibuilder: Check before casting to IOPIRuntime for open-in-view

Guard against cast error, which might help to fix #306