mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-13 04:56:34 +03:00
Fix: url may be empty, so check it
This commit is contained in:
parent
74233d7fa8
commit
bc2ceed1dc
|
@ -75,11 +75,16 @@ export default function getExcEditor(theState) {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
||||||
super(props);
|
super(props);
|
||||||
|
const trimmedInputValueOrSpace =
|
||||||
|
props.currentTab &&
|
||||||
|
props.currentTab.url &&
|
||||||
|
!props.currentTab.url.startsWith('chrome')
|
||||||
|
? new URL(props.currentTab.url).hostname
|
||||||
|
: '';
|
||||||
|
|
||||||
const pacMods = props.apis.pacKitchen.getPacMods();
|
const pacMods = props.apis.pacKitchen.getPacMods();
|
||||||
this.state = {
|
this.state = {
|
||||||
trimmedInputValueOrSpace:
|
trimmedInputValueOrSpace,
|
||||||
props.currentTab && !props.currentTab.url.startsWith('chrome') ? new URL(props.currentTab.url).hostname : '',
|
|
||||||
sortedListOfOptions: this.modsToOpts(pacMods),
|
sortedListOfOptions: this.modsToOpts(pacMods),
|
||||||
isHostHidden: {}
|
isHostHidden: {}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user