Index: mythtv/programs/mythbackend/mainserver.cpp
===================================================================
--- mythtv/programs/mythbackend/mainserver.cpp	(revision 17892)
+++ mythtv/programs/mythbackend/mainserver.cpp	(working copy)
@@ -3436,17 +3436,19 @@
     ProgramInfo *pginfo = ProgramInfo::GetProgramFromRecorded(chanid,
                                                               startdt);
 
-    if (commbreak)
-        pginfo->GetCommBreakList(markMap);
-    else
-        pginfo->GetCutList(markMap);
+    if (pginfo) {
+        if (commbreak)
+            pginfo->GetCommBreakList(markMap);
+        else
+            pginfo->GetCutList(markMap);
 
-    for (it = markMap.begin(); it != markMap.end(); ++it)
-    {
-        rowcnt++;
-        QString intstr = QString("%1").arg(it.data());
-        retlist << intstr;
-        encodeLongLong(retlist,it.key());
+        for (it = markMap.begin(); it != markMap.end(); ++it)
+        {
+            rowcnt++;
+            QString intstr = QString("%1").arg(it.data());
+            retlist << intstr;
+            encodeLongLong(retlist,it.key());
+        }
     }
 
     if (rowcnt > 0)
@@ -3508,11 +3510,11 @@
     QDateTime startdt;
     startdt.setTime_t((uint)atoi(starttime));
     QStringList retlist;
-    long long bookmark;
+    long long bookmark = -1;
 
     ProgramInfo *pginfo = ProgramInfo::GetProgramFromRecorded(chanid,
                                                               startdt);
-    bookmark = pginfo->GetBookmark();
+    if (pginfo) bookmark = pginfo->GetBookmark();
 
     encodeLongLong(retlist,bookmark);
 
@@ -3550,9 +3552,13 @@
 
     ProgramInfo *pginfo = ProgramInfo::GetProgramFromRecorded(chanid,
                                                               startdt);
-    pginfo->SetBookmark(bookmark);
+    if (pginfo) {
+        pginfo->SetBookmark(bookmark);
+        retlist << "OK";
+    }
+    else
+        retlist << "FAILED";
 
-    retlist << "OK";
     if (pbssock)
         SendResponse(pbssock, retlist);
 
