Fixed user profile page returning internal server error if JSON file is missing.
This commit is contained in:
@@ -32,7 +32,11 @@ class UsersController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@ban_json = JSON.parse(File.read("/etc/minecraft/redstoner/banned-players.json")).detect {|u| u["uuid"].tr("-", "") == @user.uuid}
|
begin
|
||||||
|
@ban_json = JSON.parse(File.read("/etc/minecraft/redstoner/banned-players.json")).detect {|u| u["uuid"].tr("-", "") == @user.uuid}
|
||||||
|
rescue
|
||||||
|
flash.now[:alert] = "An error occured while checking if this user is banned from the server!"
|
||||||
|
@ban_json = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# SIGNUP
|
# SIGNUP
|
||||||
|
|||||||
Reference in New Issue
Block a user