Skip to content

Commit ab00d47

Browse files
committed
fix getPlugin types
1 parent e465e41 commit ab00d47

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

exampleVault/Test.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
text: this is reactive
33
number: 12234234
4+
favoritePrime: 191
45
---
56

67
```js

jsEngine/api/API.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ export class API {
7373

7474
/**
7575
* Gets a plugin by its id. A plugin id can be found by looking at its manifest.
76+
* If the plugin is not enabled, this will return undefined.
7677
*
7778
* @param pluginId the id of the plugin.
7879
*/
79-
public getPlugin(pluginId: string): Plugin {
80-
return this.app.plugins.getPlugin(pluginId);
80+
public getPlugin(pluginId: string): Plugin | undefined {
81+
return this.app.plugins.getPlugin(pluginId) ?? undefined;
8182
}
8283

8384
/**

0 commit comments

Comments
 (0)