Browse Source

docs: fix return type of getPrinters (#21422)

trop[bot] 5 years ago
parent
commit
6fe40ca797
2 changed files with 2 additions and 1 deletions
  1. 1 1
      docs/api/web-contents.md
  2. 1 0
      lib/browser/api/web-contents.js

+ 1 - 1
docs/api/web-contents.md

@@ -1236,7 +1236,7 @@ Captures a snapshot of the page within `rect`. Omitting `rect` will capture the
 
 Get the system printer list.
 
-Returns [`PrinterInfo[]`](structures/printer-info.md).
+Returns [`PrinterInfo[]`](structures/printer-info.md)
 
 #### `contents.print([options], [callback])`
 

+ 1 - 0
lib/browser/api/web-contents.js

@@ -266,6 +266,7 @@ WebContents.prototype.getPrinters = function () {
     return this._getPrinters()
   } else {
     console.error('Error: Printing feature is disabled.')
+    return []
   }
 }