--- mergePolyMesh.C	2017-10-18 16:18:01.127756622 +0200
+++ mergePolyMesh-fixed.C	2017-10-16 13:35:07.000000000 +0200
@@ -410,6 +410,7 @@
         Info<< "Adding new patches. " << endl;
 
         label endOfLastPatch =
+            patchi == 0 ? 0 :
             oldPatches[patchi - 1].start() + oldPatches[patchi - 1].size();
 
         for (; patchi < patchNames_.size(); patchi++)
