ComputerScienceHouse/Drink-JS — Issue #35: GETBALANCE fails when user has 0 credits. Can still drop items with price 0
Author: agargiulo
Created: 2012-01-15 06:42:40+00:00
State: open

user agargiulo
OK:
pass *****************
OK: 0
getbalance
ERR 204 You need to login.
machine s
OK: Welcome to Snack
stat
...
18 "Test item" 0 8968 1
...
OK 19 Slots retrieved
drop 18
OK: Dropping drink
stat
...
18 "Test item" 0 8967 1
...
OK 19 Slots retrieved

This could have to do with the fact that Javascript sees `false` and `0` as equal at times.
The following based of what Andrew Hanes found in your code:

```javascript
var balance = 0;
if(balance != false)
{
document.write("User logged in");
}
else
{
document.write("No User Logged In");
}
```
This, when we ran it through an interpreter wrote "No User Logged In" to the page