Merge "Add empty callback function to register layer"
diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-annotation-actions-js-api.ts b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-annotation-actions-js-api.ts
index 95252cf..a3d038d 100644
--- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-annotation-actions-js-api.ts
+++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-annotation-actions-js-api.ts
@@ -120,12 +120,8 @@
    * Don't forget to also call disposeLayer().
    */
   createLayer(path: string, changeNum: number) {
-    if (!this.annotationCallback) return undefined;
-    const annotationLayer = new AnnotationLayer(
-      path,
-      changeNum,
-      this.annotationCallback
-    );
+    const callbackFn = this.annotationCallback || (() => {});
+    const annotationLayer = new AnnotationLayer(path, changeNum, callbackFn);
     this.annotationLayers.push(annotationLayer);
     return annotationLayer;
   }