--- a/src/qtgui/rclmain_w.cpp
+++ b/src/qtgui/rclmain_w.cpp
@@ -423,6 +423,14 @@
Rcl::Doc doc;
if (!rcldb->getDoc(udi, doc) || doc.pc == -1)
return;
+
+ // StartNativeViewer needs a db source to call getEnclosing() on.
+ Rcl::Query *query = new Rcl::Query(rcldb);
+ DocSequenceDb *src =
+ new DocSequenceDb(RefCntr<Rcl::Query>(query), "",
+ RefCntr<Rcl::SearchData>(new Rcl::SearchData));
+ m_source = RefCntr<DocSequence>(src);
+
// Start a native viewer if the mimetype has one defined, else a
// preview.