File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/plugin-ext/src/plugin Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ import { WindowState } from '@theia/plugin';
1919import { WindowStateExt , WindowMain , PLUGIN_RPC_CONTEXT } from '../common/plugin-api-rpc' ;
2020import { Event , Emitter } from '@theia/core/lib/common/event' ;
2121import { RPCProtocol } from '../common/rpc-protocol' ;
22- import { Schemes } from '../common/uri-components' ;
2322
2423export class WindowStateExtImpl implements WindowStateExt {
2524
@@ -50,16 +49,17 @@ export class WindowStateExtImpl implements WindowStateExt {
5049 }
5150
5251 openUri ( uri : URI ) : Promise < boolean > {
52+ if ( ! uri . scheme . trim ( ) . length ) {
53+ throw new Error ( 'Invalid scheme - cannot be empty' ) ;
54+ }
55+
5356 return this . proxy . $openUri ( uri ) ;
5457 }
5558
5659 async asExternalUri ( target : URI ) : Promise < URI > {
5760 if ( ! target . scheme . trim ( ) . length ) {
5861 throw new Error ( 'Invalid scheme - cannot be empty' ) ;
5962 }
60- if ( Schemes . http !== target . scheme && Schemes . https !== target . scheme ) {
61- throw new Error ( `Invalid scheme '${ target . scheme } '` ) ;
62- }
6363
6464 const uri = await this . proxy . $asExternalUri ( target ) ;
6565 return URI . revive ( uri ) ;
You can’t perform that action at this time.
0 commit comments