We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45e265d commit 0de2b51Copy full SHA for 0de2b51
main.ts
@@ -166,9 +166,12 @@ export default class WikipediaPlugin extends Plugin {
166
}
167
168
async getWikipediaTextForActiveFile(editor: Editor) {
169
- const searchTerm = await this.app.workspace.getActiveFile().basename;
170
- if (searchTerm) {
171
- await this.pasteIntoEditor(editor, searchTerm);
+ const activeFile = await this.app.workspace.getActiveFile();
+ if (activeFile) {
+ const searchTerm = activeFile.basename;
172
+ if (searchTerm) {
173
+ await this.pasteIntoEditor(editor, searchTerm);
174
+ }
175
176
177
0 commit comments