Skip to content

Commit af4e7d9

Browse files
author
Guillaume Chau
committed
Fix crash
1 parent e8112ad commit af4e7d9

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

packages/vue-component/.versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
22
33
44

packages/vue-component/package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
name: 'akryum:vue-component',
3-
version: '0.12.1',
3+
version: '0.12.2',
44
summary: 'VueJS single-file components that hot-reloads',
55
git: 'https://github.com/Akryum/meteor-vue-component',
66
documentation: 'README.md'

packages/vue-component/plugin/dev-server.js

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,28 @@ if(Meteor.isDevelopment) {
4141
const index = argv.findIndex(
4242
arg => arg.indexOf('-p') === 0 || arg.indexOf('--port') === 0
4343
)
44-
const arg = argv[index]
45-
const equalIndex = arg.indexOf('=')
46-
let value
47-
if (equalIndex !== -1) {
48-
value = arg.substr(equalIndex + 1)
49-
} else {
50-
value = argv[index + 1]
51-
}
52-
const results = value.split(':')
53-
let interface
54-
let port
55-
if (results.length === 2) {
56-
interface = results[0]
57-
port = results[1]
58-
} else {
59-
port = results[0]
60-
}
61-
return {
62-
interface,
63-
port: parseInt(port),
44+
if (index !== -1) {
45+
const arg = argv[index]
46+
const equalIndex = arg.indexOf('=')
47+
let value
48+
if (equalIndex !== -1) {
49+
value = arg.substr(equalIndex + 1)
50+
} else {
51+
value = argv[index + 1]
52+
}
53+
const results = value.split(':')
54+
let interface
55+
let port
56+
if (results.length === 2) {
57+
interface = results[0]
58+
port = results[1]
59+
} else {
60+
port = results[0]
61+
}
62+
return {
63+
interface,
64+
port: parseInt(port),
65+
}
6466
}
6567
} else {
6668
const reg = /(?:--port|-p)(?:=|\s)(?:([0-9.]+):)?(\d+)/gi

0 commit comments

Comments
 (0)